From 0afb1d4d51973cf52973617c92236d851a039d31 Mon Sep 17 00:00:00 2001 From: manuel Date: Sat, 2 Sep 2017 15:02:54 +0200 Subject: sync with upstream --- cmake/scripts/linux/ArchSetup.cmake | 19 +++++++++++++++++++ cmake/scripts/linux/ExtraTargets.cmake | 14 ++++++++++++++ 2 files changed, 33 insertions(+) (limited to 'cmake/scripts/linux') diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake index bf32fe0..74018d0 100644 --- a/cmake/scripts/linux/ArchSetup.cmake +++ b/cmake/scripts/linux/ArchSetup.cmake @@ -42,9 +42,28 @@ if(CMAKE_BUILD_TYPE STREQUAL Release AND CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") endif() +if(KODI_DEPENDSBUILD) + # Binaries should be directly runnable from host, so include rpath to depends + set(CMAKE_INSTALL_RPATH "${DEPENDS_PATH}/lib") + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +endif() + find_package(CXX11 REQUIRED) include(LDGOLD) +include(CheckIncludeFiles) +check_include_files("linux/memfd.h" HAVE_LINUX_MEMFD) +if(HAVE_LINUX_MEMFD) + list(APPEND ARCH_DEFINES "-DHAVE_LINUX_MEMFD=1") +endif() +include(CheckSymbolExists) +set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") +check_symbol_exists("mkostemp" "stdlib.h" HAVE_MKOSTEMP) +set(CMAKE_REQUIRED_DEFINITIONS "") +if(HAVE_MKOSTEMP) + list(APPEND ARCH_DEFINES "-DHAVE_MKOSTEMP=1" "-D_GNU_SOURCE") +endif() + # Code Coverage if(CMAKE_BUILD_TYPE STREQUAL Coverage) set(COVERAGE_TEST_BINARY ${APP_NAME_LC}-test) diff --git a/cmake/scripts/linux/ExtraTargets.cmake b/cmake/scripts/linux/ExtraTargets.cmake index e89aab6..4753f73 100644 --- a/cmake/scripts/linux/ExtraTargets.cmake +++ b/cmake/scripts/linux/ExtraTargets.cmake @@ -13,3 +13,17 @@ if(ENABLE_EVENTCLIENTS AND BLUETOOTH_FOUND) add_subdirectory(${CMAKE_SOURCE_DIR}/tools/EventClients/Clients/WiiRemote build/WiiRemote) endif() endif() + +if(CORE_PLATFORM_NAME_LC STREQUAL "wayland") + # This cannot go into wayland.cmake since it requires the Wayland dependencies + # to already be resolved + set(PROTOCOL_XMLS "${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-shell/xdg-shell-unstable-v6.xml" + "${WAYLAND_PROTOCOLS_DIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml") + add_custom_command(OUTPUT "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp" + COMMAND "${WAYLANDPP_SCANNER}" ${PROTOCOL_XMLS} "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp" + DEPENDS "${WAYLANDPP_SCANNER}" ${PROTOCOL_XMLS} + COMMENT "Generating wayland-protocols C++ wrappers") + + # Dummy target for dependencies + add_custom_target(generate-wayland-extra-protocols DEPENDS wayland-extra-protocols.hpp) +endif() \ No newline at end of file -- cgit v1.2.3