Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-10-07 23:57:14 +0300
committerCampbell Barton <campbell@blender.org>2022-10-08 00:00:17 +0300
commitd779792977d3b6bd941eb5359cb9d982b1d22458 (patch)
treebaaded1b806748b1b8d9813d1e97f5e2866b6d9f
parent66f184d981ff62e81eb366274f8e20b97dedc2ed (diff)
Build: reference bundled wayland and libdecor headers
When using pre-compiled libs, reference the bundled wayland headers, needed so the headers from the bundled wayland-scanner are compatible. Part of D16091.
-rw-r--r--build_files/cmake/platform/platform_unix.cmake38
1 files changed, 31 insertions, 7 deletions
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index 0aab46b1250..0b137ae93d6 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -699,14 +699,23 @@ endif()
if(WITH_GHOST_WAYLAND)
find_package(PkgConfig)
- pkg_check_modules(wayland-client wayland-client>=1.12)
- pkg_check_modules(wayland-egl wayland-egl)
- pkg_check_modules(wayland-scanner wayland-scanner)
pkg_check_modules(xkbcommon xkbcommon)
- pkg_check_modules(wayland-cursor wayland-cursor)
- pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
- if(${wayland-protocols_FOUND})
+ # When dynamically linked WAYLAND is used and `${LIBDIR}/wayland` is present,
+ # there is no need to search for the libraries as they are not needed for building.
+ # Only the headers are needed which can reference the known paths.
+ if(EXISTS "${LIBDIR}/wayland" AND WITH_GHOST_WAYLAND_DYNLOAD)
+ set(_use_system_wayland OFF)
+ else()
+ set(_use_system_wayland ON)
+ endif()
+
+ if(_use_system_wayland)
+ pkg_check_modules(wayland-client wayland-client>=1.12)
+ pkg_check_modules(wayland-egl wayland-egl)
+ pkg_check_modules(wayland-scanner wayland-scanner)
+ pkg_check_modules(wayland-cursor wayland-cursor)
+ pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
else()
# CentOS 7 packages have too old a version, a newer version exist in the
@@ -720,6 +729,15 @@ if(WITH_GHOST_WAYLAND)
if(EXISTS ${WAYLAND_PROTOCOLS_DIR})
set(wayland-protocols_FOUND ON)
endif()
+
+ set(wayland-client_INCLUDE_DIRS "${LIBDIR}/wayland/include")
+ set(wayland-egl_INCLUDE_DIRS "${LIBDIR}/wayland/include")
+ set(wayland-cursor_INCLUDE_DIRS "${LIBDIR}/wayland/include")
+
+ set(wayland-client_FOUND ON)
+ set(wayland-egl_FOUND ON)
+ set(wayland-scanner_FOUND ON)
+ set(wayland-cursor_FOUND ON)
endif()
if (NOT ${wayland-client_FOUND})
@@ -753,7 +771,11 @@ if(WITH_GHOST_WAYLAND)
endif()
if(WITH_GHOST_WAYLAND_LIBDECOR)
- pkg_check_modules(libdecor REQUIRED libdecor-0>=0.1)
+ if(_use_system_wayland)
+ pkg_check_modules(libdecor REQUIRED libdecor-0>=0.1)
+ else()
+ set(libdecor_INCLUDE_DIRS "${LIBDIR}/wayland_libdecor/include/libdecor-0")
+ endif()
endif()
list(APPEND PLATFORM_LINKLIBS
@@ -823,6 +845,8 @@ if(WITH_GHOST_WAYLAND)
# End wayland-scanner version check.
endif()
+
+ unset(_use_system_wayland)
endif()
if(WITH_GHOST_X11)