diff options
Diffstat (limited to 'cmake/scripts/common/ArchSetup.cmake')
| -rw-r--r-- | cmake/scripts/common/ArchSetup.cmake | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake index 07ce6d4..2e1eb12 100644 --- a/cmake/scripts/common/ArchSetup.cmake +++ b/cmake/scripts/common/ArchSetup.cmake | |||
| @@ -18,24 +18,7 @@ include(CheckCXXSourceCompiles) | |||
| 18 | include(CheckSymbolExists) | 18 | include(CheckSymbolExists) |
| 19 | include(CheckFunctionExists) | 19 | include(CheckFunctionExists) |
| 20 | include(CheckIncludeFile) | 20 | include(CheckIncludeFile) |
| 21 | 21 | include(CheckTypeSize) | |
| 22 | # Macro to check if a given type exists in a given header | ||
| 23 | # Arguments: | ||
| 24 | # header the header to check | ||
| 25 | # type the type to check for existence | ||
| 26 | # var the compiler definition to set if type exists | ||
| 27 | # On return: | ||
| 28 | # If type was found, the definition is added to SYSTEM_DEFINES | ||
| 29 | macro(check_type header type var) | ||
| 30 | check_cxx_source_compiles("#include <${header}> | ||
| 31 | int main() | ||
| 32 | { | ||
| 33 | ${type} s; | ||
| 34 | }" ${var}) | ||
| 35 | if(${var}) | ||
| 36 | list(APPEND SYSTEM_DEFINES -D${var}=1) | ||
| 37 | endif() | ||
| 38 | endmacro() | ||
| 39 | 22 | ||
| 40 | # Macro to check if a given builtin function exists | 23 | # Macro to check if a given builtin function exists |
| 41 | # Arguments: | 24 | # Arguments: |
| @@ -95,17 +78,12 @@ endif() | |||
| 95 | include(${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) | 78 | include(${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) |
| 96 | 79 | ||
| 97 | message(STATUS "Core system type: ${CORE_SYSTEM_NAME}") | 80 | message(STATUS "Core system type: ${CORE_SYSTEM_NAME}") |
| 98 | message(STATUS "Platform: ${PLATFORM}") | 81 | message(STATUS "Platform: ${CORE_PLATFORM_NAME}") |
| 99 | message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}") | 82 | message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}") |
| 100 | message(STATUS "Cross-Compiling: ${CMAKE_CROSSCOMPILING}") | 83 | message(STATUS "Cross-Compiling: ${CMAKE_CROSSCOMPILING}") |
| 101 | message(STATUS "Execute build artefacts on host: ${CORE_HOST_IS_TARGET}") | 84 | message(STATUS "Execute build artefacts on host: ${CORE_HOST_IS_TARGET}") |
| 102 | message(STATUS "Depends based build: ${KODI_DEPENDSBUILD}") | 85 | message(STATUS "Depends based build: ${KODI_DEPENDSBUILD}") |
| 103 | 86 | ||
| 104 | check_type(string std::u16string HAVE_STD__U16_STRING) | ||
| 105 | check_type(string std::u32string HAVE_STD__U32_STRING) | ||
| 106 | check_type(string char16_t HAVE_CHAR16_T) | ||
| 107 | check_type(string char32_t HAVE_CHAR32_T) | ||
| 108 | check_type(stdint.h uint_least16_t HAVE_STDINT_H) | ||
| 109 | check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) | 87 | check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) |
| 110 | check_symbol_exists(PRIdMAX inttypes.h HAVE_INTTYPES_H) | 88 | check_symbol_exists(PRIdMAX inttypes.h HAVE_INTTYPES_H) |
| 111 | check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH) | 89 | check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH) |
