From 3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 4 Mar 2021 23:36:40 +0100 Subject: sync with upstream --- cmake/scripts/android/Install.cmake | 1 + cmake/scripts/common/Macros.cmake | 16 ++++++--- cmake/scripts/common/Platform.cmake | 50 ++++++++++++++++++++--------- cmake/scripts/darwin_embedded/Install.cmake | 5 --- cmake/scripts/linux/ExtraTargets.cmake | 2 +- cmake/scripts/osx/ArchSetup.cmake | 2 ++ cmake/scripts/osx/Install.cmake | 1 + cmake/scripts/windows/ArchSetup.cmake | 4 ++- cmake/scripts/windowsstore/ArchSetup.cmake | 2 +- 9 files changed, 56 insertions(+), 27 deletions(-) (limited to 'cmake/scripts') diff --git a/cmake/scripts/android/Install.cmake b/cmake/scripts/android/Install.cmake index 5b7b411..1dc33af 100644 --- a/cmake/scripts/android/Install.cmake +++ b/cmake/scripts/android/Install.cmake @@ -70,6 +70,7 @@ set(package_files strings.xml src/XBMCProperties.java src/XBMCVideoView.java src/XBMCFile.java + src/XBMCURIUtils.java src/channels/SyncChannelJobService.java src/channels/SyncProgramsJobService.java src/channels/model/XBMCDatabase.java diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake index d896651..757d3ee 100644 --- a/cmake/scripts/common/Macros.cmake +++ b/cmake/scripts/common/Macros.cmake @@ -221,11 +221,19 @@ function(copy_file_to_buildtree file) endif() if(NOT file STREQUAL ${CMAKE_BINARY_DIR}/${outfile}) - if(VERBOSE) - message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") + if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" OR NOT IS_SYMLINK "${file}") + if(VERBOSE) + message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") + endif() + file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake + "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n" ) + else() + if(VERBOSE) + message(STATUS "copy_file_to_buildtree - copying symlinked file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") + endif() + file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake + "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy_if_different \"${file}\" \"${CMAKE_BINARY_DIR}/${outfile}\")\n") endif() - file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake - "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n") endif() if(NOT arg_NO_INSTALL) diff --git a/cmake/scripts/common/Platform.cmake b/cmake/scripts/common/Platform.cmake index 5ac233a..397d8d4 100644 --- a/cmake/scripts/common/Platform.cmake +++ b/cmake/scripts/common/Platform.cmake @@ -3,10 +3,13 @@ if(NOT CORE_SYSTEM_NAME) endif() if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) - # Set default CORE_PLATFORM_NAME to X11 + # Set default CORE_PLATFORM_NAME to X11 WAYLAND GBM # This is overridden by user setting -DCORE_PLATFORM_NAME= - set(_DEFAULT_PLATFORM X11) - option(ENABLE_APP_AUTONAME "Enable renaming the binary according to windowing?" ON) + set(_DEFAULT_PLATFORM X11 WAYLAND GBM) + + if(NOT APP_RENDER_SYSTEM) + message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering. Please set APP_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") + endif() else() string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) endif() @@ -18,20 +21,37 @@ set(APP_BINARY_SUFFIX ".bin") # use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead # if(NOT CORE_PLATFORM_NAME) - set(CORE_PLATFORM_NAME ${_DEFAULT_PLATFORM} CACHE STRING "Platform port to build") + set(CORE_PLATFORM_NAME ${_DEFAULT_PLATFORM}) endif() +set(CORE_PLATFORM_NAME ${CORE_PLATFORM_NAME} CACHE STRING "Platform port to build" FORCE) unset(_DEFAULT_PLATFORM) -string(TOLOWER ${CORE_PLATFORM_NAME} CORE_PLATFORM_NAME_LC) -list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}") -if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) - include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) - if(ENABLE_APP_AUTONAME) - set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}") +string(REPLACE " " ";" CORE_PLATFORM_NAME "${CORE_PLATFORM_NAME}") +foreach(platform IN LISTS CORE_PLATFORM_NAME) + string(TOLOWER ${platform} platform) + list(APPEND CORE_PLATFORM_NAME_LC ${platform}) +endforeach() + +string(REPLACE ";" " " CORE_PLATFORM_STRING "${CORE_PLATFORM_NAME_LC}") +list(APPEND final_message "Platforms: ${CORE_PLATFORM_STRING}") + +if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) + list(LENGTH CORE_PLATFORM_NAME_LC PLATFORM_COUNT) + if(PLATFORM_COUNT EQUAL 1) + option(ENABLE_APP_AUTONAME "Enable renaming the binary according to windowing?" ON) + if(ENABLE_APP_AUTONAME) + set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}") + endif() endif() -else() - file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ - ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) - string(REPLACE ".cmake" " " _platformnames ${_platformnames}) - message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") endif() + +foreach(CORE_PLATFORM_LC IN LISTS CORE_PLATFORM_NAME_LC) + if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_LC}.cmake) + include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_LC}.cmake) + else() + file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ + ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) + string(REPLACE ".cmake" " " _platformnames ${_platformnames}) + message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") + endif() +endforeach() diff --git a/cmake/scripts/darwin_embedded/Install.cmake b/cmake/scripts/darwin_embedded/Install.cmake index af18277..02464ee 100644 --- a/cmake/scripts/darwin_embedded/Install.cmake +++ b/cmake/scripts/darwin_embedded/Install.cmake @@ -122,11 +122,6 @@ endif() set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh @ONLY) - -if(CORE_PLATFORM_NAME_LC STREQUAL ios) - configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/darwin_embedded/migrate_to_kodi.sh.in - ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded/migrate_to_kodi.sh @ONLY) -endif() add_custom_target(deb COMMAND sh ./mkdeb-darwin_embedded.sh ${CORE_BUILD_CONFIG} diff --git a/cmake/scripts/linux/ExtraTargets.cmake b/cmake/scripts/linux/ExtraTargets.cmake index 37d196a..61c76a8 100644 --- a/cmake/scripts/linux/ExtraTargets.cmake +++ b/cmake/scripts/linux/ExtraTargets.cmake @@ -14,7 +14,7 @@ if(ENABLE_EVENTCLIENTS AND BLUETOOTH_FOUND) endif() endif() -if(CORE_PLATFORM_NAME_LC STREQUAL "wayland") +if("wayland" IN_LIST CORE_PLATFORM_NAME_LC) # This cannot go into wayland.cmake since it requires the Wayland dependencies # to already be resolved set(PROTOCOL_XMLS "${WAYLANDPP_PROTOCOLS_DIR}/presentation-time.xml" diff --git a/cmake/scripts/osx/ArchSetup.cmake b/cmake/scripts/osx/ArchSetup.cmake index 7d8f58b..f723aa2 100644 --- a/cmake/scripts/osx/ArchSetup.cmake +++ b/cmake/scripts/osx/ArchSetup.cmake @@ -23,6 +23,8 @@ else() endif() endif() +set(CMAKE_OSX_ARCHITECTURES ${CPU}) + # Additional SYSTEM_DEFINES list(APPEND SYSTEM_DEFINES -DHAS_POSIX_NETWORK -DHAS_OSX_NETWORK -DHAS_SDL -DHAS_ZEROCONF) diff --git a/cmake/scripts/osx/Install.cmake b/cmake/scripts/osx/Install.cmake index 629bc09..2ae41f5 100644 --- a/cmake/scripts/osx/Install.cmake +++ b/cmake/scripts/osx/Install.cmake @@ -52,6 +52,7 @@ add_custom_target(dmg "DEV_TEAM=${DEV_TEAM}" "EXPANDED_CODE_SIGN_IDENTITY_NAME=${CODE_SIGN_IDENTITY}" "PLATFORM_NAME=${PLATFORM}" + "XCODE_BUILDTYPE=${CMAKE_CFG_INTDIR}" ./mkdmg-osx.sh ${CORE_BUILD_CONFIG_LOWERCASED} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx) set_target_properties(dmg PROPERTIES FOLDER "Build Utilities") diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake index f3628f2..9c382da 100644 --- a/cmake/scripts/windows/ArchSetup.cmake +++ b/cmake/scripts/windows/ArchSetup.cmake @@ -32,9 +32,11 @@ set(DEPS_FOLDER_RELATIVE project/BuildDependencies) set(DEPENDENCIES_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/${ARCH}) set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/${ARCH}) +# mingw libs list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) -list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) +# dependencies +list(PREPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) # -------- Compiler options --------- diff --git a/cmake/scripts/windowsstore/ArchSetup.cmake b/cmake/scripts/windowsstore/ArchSetup.cmake index ad55a01..5a90683 100644 --- a/cmake/scripts/windowsstore/ArchSetup.cmake +++ b/cmake/scripts/windowsstore/ArchSetup.cmake @@ -52,7 +52,7 @@ set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/win10-$ list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) # dependencies -list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) +list(PREPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) # -------- Compiler options --------- -- cgit v1.2.3