diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-27 04:54:35 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-27 12:22:07 +0300 |
commit | cbab734445060e4dc39a37a7164282910a8fad11 (patch) | |
tree | 8068412b77d76559fd2bde9a91a5db5902b7f2b3 | |
parent | 5f6d66c1c5f4a704d73a0aed8d13af53cf09bb52 (diff) |
Build: add wayland to deps build
This is needed to ensure and up to date "wayland-scanner" is used,
as versions before 1.20.0 generate headers incompatible with
dynamic linking (WITH_GHOST_WAYLAND_DYNLOAD).
As the centos7 version of wayland is 1.15 so make this part of Blender's
dependencies on Linux.
We intend to enable Wayland for Blender 3.4 release, this is needed for
the build-bot.
Reviewed By: brecht
Ref D16074
-rw-r--r-- | build_files/build_environment/CMakeLists.txt | 2 | ||||
-rw-r--r-- | build_files/build_environment/cmake/download.cmake | 1 | ||||
-rw-r--r-- | build_files/build_environment/cmake/harvest.cmake | 1 | ||||
-rw-r--r-- | build_files/build_environment/cmake/versions.cmake | 6 | ||||
-rw-r--r-- | build_files/build_environment/cmake/wayland.cmake | 18 | ||||
-rw-r--r-- | build_files/cmake/platform/platform_unix.cmake | 6 |
6 files changed, 33 insertions, 1 deletions
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt index 8c427c63944..468a434b887 100644 --- a/build_files/build_environment/CMakeLists.txt +++ b/build_files/build_environment/CMakeLists.txt @@ -170,6 +170,8 @@ if(UNIX AND NOT APPLE) include(cmake/libglu.cmake) include(cmake/mesa.cmake) include(cmake/wayland_protocols.cmake) + # Can be removed when the build-bot upgrades to v1.20.x or newer. + include(cmake/wayland.cmake) endif() include(cmake/harvest.cmake) diff --git a/build_files/build_environment/cmake/download.cmake b/build_files/build_environment/cmake/download.cmake index 82f5d8260b7..c5b0c5ede84 100644 --- a/build_files/build_environment/cmake/download.cmake +++ b/build_files/build_environment/cmake/download.cmake @@ -89,6 +89,7 @@ download_source(MESA) download_source(NASM) download_source(XR_OPENXR_SDK) download_source(WL_PROTOCOLS) +download_source(WAYLAND) download_source(ISPC) download_source(GMP) download_source(POTRACE) diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index e18c22fc4ad..6c920e651fe 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -117,6 +117,7 @@ else() harvest(xml2/lib xml2/lib "*.a") harvest(wayland-protocols/share/wayland-protocols wayland-protocols/share/wayland-protocols/ "*.xml") + harvest(wayland/bin wayland/bin "wayland-scanner") else() harvest(blosc/lib openvdb/lib "*.a") harvest(xml2/lib opencollada/lib "*.a") diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index a03adcbad7b..a6ff4628325 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -458,6 +458,12 @@ set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/ set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a) set(WL_PROTOCOLS_HASH_TYPE MD5) +set(WAYLAND_VERSION 1.21.0) +set(WAYLAND_FILE wayland-${WAYLAND_VERSION}.tar.xz) +set(WAYLAND_URI https://wayland.freedesktop.org/releases/wayland-${WAYLAND_VERSION}.tar.xz) +set(WAYLAND_HASH f2653a2293bcd882d756c6a83d278903) +set(WAYLAND_HASH_TYPE MD5) + set(ISPC_VERSION v1.17.0) set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz) set(ISPC_HASH 4f476a3109332a77fe839a9014c60ca9) diff --git a/build_files/build_environment/cmake/wayland.cmake b/build_files/build_environment/cmake/wayland.cmake new file mode 100644 index 00000000000..0f800b2e7eb --- /dev/null +++ b/build_files/build_environment/cmake/wayland.cmake @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +ExternalProject_Add(external_wayland + URL file://${PACKAGE_DIR}/${WAYLAND_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${WAYLAND_HASH_TYPE}=${WAYLAND_HASH} + PREFIX ${BUILD_DIR}/wayland + # Use `-E` so the `PKG_CONFIG_PATH` can be defined to link against our own LIBEXPAT. + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/expat/lib/pkgconfig + meson --prefix ${LIBDIR}/wayland . ../external_wayland + BUILD_COMMAND ninja + INSTALL_COMMAND ninja install +) + +add_dependencies( + external_wayland + external_expat +) diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index f640f7f7650..6ad4547fa00 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -764,7 +764,11 @@ if(WITH_GHOST_WAYLAND) add_definitions(-DWITH_GHOST_WAYLAND_LIBDECOR) endif() - pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner) + if(EXISTS "${LIBDIR}/wayland/bin/wayland-scanner") + set(WAYLAND_SCANNER "${LIBDIR}/wayland/bin/wayland-scanner") + else() + pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner) + endif() # When using dynamic loading, headers generated # from older versions of `wayland-scanner` aren't compatible. |