Skip to content

Commit

Permalink
CMake Build: Fix libdrm detection and compilation on QNX
Browse files Browse the repository at this point in the history
On QNX 7.1 x86drm.h is located under <...>/usr/include/libdrm, unlike
linux where it's present under /usr/include.

find_path would not find it on QNX, and instead get /usr/include from
host, which resulted in a failure to compile.

Task-number: QTBUG-83202
Change-Id: I03d6c2d4dfbe91bb70df0a322e84890bd7c8548a
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
cristianadam committed Aug 19, 2020
1 parent 41800c3 commit 12e4b63
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cmake/3rdparty/kwin/FindLibdrm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ if(NOT WIN32)
xf86drm.h
HINTS
${PKG_Libdrm_INCLUDE_DIRS}
PATH_SUFFIXES
libdrm
)
find_library(Libdrm_LIBRARY
NAMES
Expand All @@ -103,14 +105,14 @@ if(NOT WIN32)
IMPORTED_LOCATION "${Libdrm_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${Libdrm_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}"
INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}/libdrm"
)
if(EXISTS "${Libdrm_INCLUDE_DIR}/drm")
set_property(TARGET Libdrm::Libdrm APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}/drm"
)
endif()

foreach(suffix libdrm drm)
if(EXISTS "${Libdrm_INCLUDE_DIR}/${suffix}")
set_property(TARGET Libdrm::Libdrm APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}/${suffix}"
)
endif()
endforeach()
endif()

mark_as_advanced(Libdrm_LIBRARY Libdrm_INCLUDE_DIR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ qt_internal_add_plugin(QEglFSKmsEglDeviceIntegrationPlugin

#### Keys ignored in scope 1:.:.:eglfs_kms_egldevice.pro:<TRUE>:
# OTHER_FILES = "$$PWD/eglfs_kms_egldevice.json"

# begin special case
qt_extend_target(QEglFSKmsEglDeviceIntegrationPlugin
CONDITION QNX
COMPILE_OPTIONS -fpermissive
)
# end special case
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ qt_add_module(EglFsKmsSupport
Qt::GuiPrivate
Qt::KmsSupportPrivate
)

# begin special case
qt_extend_target(EglFsKmsSupport
CONDITION QNX
COMPILE_OPTIONS -fpermissive
)
# end special case

0 comments on commit 12e4b63

Please sign in to comment.