From 0ef988a03e2bff7e1869d4d166688dedc88a07cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81o=C5=9B?= Date: Tue, 1 Oct 2024 15:34:16 +0200 Subject: [PATCH] Enable eglfs_kms building on VxWorks VxWorks uses non-standard libraries naming and merges some other together. To fix this, in order to detect libdrm library, an alternative name needs to be used on VxWorks: `gfxLibDRM`, and search for `gfxMesaEGL` which contains `gbm` library symbols. This will enable building `eglfs_kms` plugin. Task-number: QTBUG-115777 Change-Id: I99b76596e9a46248407e8b846cf7507f436f1767 Reviewed-by: Alexandru Croitor --- cmake/3rdparty/kwin/FindLibdrm.cmake | 11 ++++++++--- cmake/3rdparty/kwin/Findgbm.cmake | 9 +++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/cmake/3rdparty/kwin/FindLibdrm.cmake b/cmake/3rdparty/kwin/FindLibdrm.cmake index a94e7fbcb60..06147a62694 100644 --- a/cmake/3rdparty/kwin/FindLibdrm.cmake +++ b/cmake/3rdparty/kwin/FindLibdrm.cmake @@ -65,10 +65,13 @@ if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) endif() if(NOT WIN32) - # Use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls + if (VXWORKS) + set(_vxworks_lib_search_path "$ENV{WIND_CC_SYSROOT}/usr/lib/common/") + set(_vxworks_lib_drm_library_name gfxLibDRM) + endif() + find_package(PkgConfig QUIET) - pkg_check_modules(PKG_Libdrm QUIET libdrm) + pkg_check_modules(PKG_Libdrm QUIET libdrm ${_vxworks_lib_drm_library_name}) set(Libdrm_DEFINITIONS ${PKG_Libdrm_CFLAGS_OTHER}) set(Libdrm_VERSION ${PKG_Libdrm_VERSION}) @@ -84,8 +87,10 @@ if(NOT WIN32) find_library(Libdrm_LIBRARY NAMES drm + ${_vxworks_lib_drm_library_name} HINTS ${PKG_Libdrm_LIBRARY_DIRS} + "${_vxworks_lib_search_path}" ) include(FindPackageHandleStandardArgs) diff --git a/cmake/3rdparty/kwin/Findgbm.cmake b/cmake/3rdparty/kwin/Findgbm.cmake index a77f7e86dbe..4ae5e449429 100644 --- a/cmake/3rdparty/kwin/Findgbm.cmake +++ b/cmake/3rdparty/kwin/Findgbm.cmake @@ -63,12 +63,15 @@ endif() if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Findgbm.cmake") endif() - if(NOT WIN32) + if(VXWORKS) + set(_vxworks_lib_search_path "$ENV{WIND_CC_SYSROOT}/usr/lib/common/") + set(_vxworks_lib_gbm_library_name gfxMesaEGL) + endif() # Use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls find_package(PkgConfig QUIET) - pkg_check_modules(PKG_gbm QUIET gbm) + pkg_check_modules(PKG_gbm QUIET gbm "${_vxworks_lib_gbm_library_name}") set(gbm_DEFINITIONS ${PKG_gbm_CFLAGS_OTHER}) set(gbm_VERSION ${PKG_gbm_VERSION}) @@ -82,8 +85,10 @@ if(NOT WIN32) find_library(gbm_LIBRARY NAMES gbm + ${_vxworks_lib_gbm_library_name} HINTS ${PKG_gbm_LIBRARY_DIRS} + "${_vxworks_lib_search_path}" ) include(FindPackageHandleStandardArgs)