diff options
| author | manuel <manuel@mausz.at> | 2021-03-04 23:36:40 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2021-03-04 23:36:40 +0100 |
| commit | 3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f (patch) | |
| tree | 921f4829b32126f80f9113c124f2e14c0ebce8d9 /cmake/scripts/common | |
| parent | be933ef2241d79558f91796cc5b3a161f72ebf9c (diff) | |
| download | kodi-pvr-build-3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f.tar.gz kodi-pvr-build-3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f.tar.bz2 kodi-pvr-build-3cb8aa05f8cee9e860cf83531682ff0ed4af6a4f.zip | |
sync with upstreamMatrix
Diffstat (limited to 'cmake/scripts/common')
| -rw-r--r-- | cmake/scripts/common/Macros.cmake | 16 | ||||
| -rw-r--r-- | cmake/scripts/common/Platform.cmake | 50 |
2 files changed, 47 insertions, 19 deletions
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) | |||
| 221 | endif() | 221 | endif() |
| 222 | 222 | ||
| 223 | if(NOT file STREQUAL ${CMAKE_BINARY_DIR}/${outfile}) | 223 | if(NOT file STREQUAL ${CMAKE_BINARY_DIR}/${outfile}) |
| 224 | if(VERBOSE) | 224 | if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" OR NOT IS_SYMLINK "${file}") |
| 225 | message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") | 225 | if(VERBOSE) |
| 226 | message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") | ||
| 227 | endif() | ||
| 228 | file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake | ||
| 229 | "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n" ) | ||
| 230 | else() | ||
| 231 | if(VERBOSE) | ||
| 232 | message(STATUS "copy_file_to_buildtree - copying symlinked file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") | ||
| 233 | endif() | ||
| 234 | file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake | ||
| 235 | "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy_if_different \"${file}\" \"${CMAKE_BINARY_DIR}/${outfile}\")\n") | ||
| 226 | endif() | 236 | endif() |
| 227 | file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake | ||
| 228 | "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n") | ||
| 229 | endif() | 237 | endif() |
| 230 | 238 | ||
| 231 | if(NOT arg_NO_INSTALL) | 239 | 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) | |||
| 3 | endif() | 3 | endif() |
| 4 | 4 | ||
| 5 | if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) | 5 | if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) |
| 6 | # Set default CORE_PLATFORM_NAME to X11 | 6 | # Set default CORE_PLATFORM_NAME to X11 WAYLAND GBM |
| 7 | # This is overridden by user setting -DCORE_PLATFORM_NAME=<platform> | 7 | # This is overridden by user setting -DCORE_PLATFORM_NAME=<platform> |
| 8 | set(_DEFAULT_PLATFORM X11) | 8 | set(_DEFAULT_PLATFORM X11 WAYLAND GBM) |
| 9 | option(ENABLE_APP_AUTONAME "Enable renaming the binary according to windowing?" ON) | 9 | |
| 10 | if(NOT APP_RENDER_SYSTEM) | ||
| 11 | 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\".") | ||
| 12 | endif() | ||
| 10 | else() | 13 | else() |
| 11 | string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) | 14 | string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) |
| 12 | endif() | 15 | endif() |
| @@ -18,20 +21,37 @@ set(APP_BINARY_SUFFIX ".bin") | |||
| 18 | # use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead | 21 | # use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead |
| 19 | # | 22 | # |
| 20 | if(NOT CORE_PLATFORM_NAME) | 23 | if(NOT CORE_PLATFORM_NAME) |
| 21 | set(CORE_PLATFORM_NAME ${_DEFAULT_PLATFORM} CACHE STRING "Platform port to build") | 24 | set(CORE_PLATFORM_NAME ${_DEFAULT_PLATFORM}) |
| 22 | endif() | 25 | endif() |
| 26 | set(CORE_PLATFORM_NAME ${CORE_PLATFORM_NAME} CACHE STRING "Platform port to build" FORCE) | ||
| 23 | unset(_DEFAULT_PLATFORM) | 27 | unset(_DEFAULT_PLATFORM) |
| 24 | string(TOLOWER ${CORE_PLATFORM_NAME} CORE_PLATFORM_NAME_LC) | ||
| 25 | 28 | ||
| 26 | list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}") | 29 | string(REPLACE " " ";" CORE_PLATFORM_NAME "${CORE_PLATFORM_NAME}") |
| 27 | if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) | 30 | foreach(platform IN LISTS CORE_PLATFORM_NAME) |
| 28 | include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) | 31 | string(TOLOWER ${platform} platform) |
| 29 | if(ENABLE_APP_AUTONAME) | 32 | list(APPEND CORE_PLATFORM_NAME_LC ${platform}) |
| 30 | set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}") | 33 | endforeach() |
| 34 | |||
| 35 | string(REPLACE ";" " " CORE_PLATFORM_STRING "${CORE_PLATFORM_NAME_LC}") | ||
| 36 | list(APPEND final_message "Platforms: ${CORE_PLATFORM_STRING}") | ||
| 37 | |||
| 38 | if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) | ||
| 39 | list(LENGTH CORE_PLATFORM_NAME_LC PLATFORM_COUNT) | ||
| 40 | if(PLATFORM_COUNT EQUAL 1) | ||
| 41 | option(ENABLE_APP_AUTONAME "Enable renaming the binary according to windowing?" ON) | ||
| 42 | if(ENABLE_APP_AUTONAME) | ||
| 43 | set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}") | ||
| 44 | endif() | ||
| 31 | endif() | 45 | endif() |
| 32 | else() | ||
| 33 | file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ | ||
| 34 | ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) | ||
| 35 | string(REPLACE ".cmake" " " _platformnames ${_platformnames}) | ||
| 36 | message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") | ||
| 37 | endif() | 46 | endif() |
| 47 | |||
| 48 | foreach(CORE_PLATFORM_LC IN LISTS CORE_PLATFORM_NAME_LC) | ||
| 49 | if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_LC}.cmake) | ||
| 50 | include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_LC}.cmake) | ||
| 51 | else() | ||
| 52 | file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ | ||
| 53 | ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) | ||
| 54 | string(REPLACE ".cmake" " " _platformnames ${_platformnames}) | ||
| 55 | message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") | ||
| 56 | endif() | ||
| 57 | endforeach() | ||
