summaryrefslogtreecommitdiffstats
path: root/cmake/scripts/common/ArchSetup.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/scripts/common/ArchSetup.cmake')
-rw-r--r--cmake/scripts/common/ArchSetup.cmake26
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)
18include(CheckSymbolExists) 18include(CheckSymbolExists)
19include(CheckFunctionExists) 19include(CheckFunctionExists)
20include(CheckIncludeFile) 20include(CheckIncludeFile)
21 21include(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
29macro(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()
38endmacro()
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()
95include(${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) 78include(${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake)
96 79
97message(STATUS "Core system type: ${CORE_SYSTEM_NAME}") 80message(STATUS "Core system type: ${CORE_SYSTEM_NAME}")
98message(STATUS "Platform: ${PLATFORM}") 81message(STATUS "Platform: ${CORE_PLATFORM_NAME}")
99message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}") 82message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}")
100message(STATUS "Cross-Compiling: ${CMAKE_CROSSCOMPILING}") 83message(STATUS "Cross-Compiling: ${CMAKE_CROSSCOMPILING}")
101message(STATUS "Execute build artefacts on host: ${CORE_HOST_IS_TARGET}") 84message(STATUS "Execute build artefacts on host: ${CORE_HOST_IS_TARGET}")
102message(STATUS "Depends based build: ${KODI_DEPENDSBUILD}") 85message(STATUS "Depends based build: ${KODI_DEPENDSBUILD}")
103 86
104check_type(string std::u16string HAVE_STD__U16_STRING)
105check_type(string std::u32string HAVE_STD__U32_STRING)
106check_type(string char16_t HAVE_CHAR16_T)
107check_type(string char32_t HAVE_CHAR32_T)
108check_type(stdint.h uint_least16_t HAVE_STDINT_H)
109check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) 87check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE)
110check_symbol_exists(PRIdMAX inttypes.h HAVE_INTTYPES_H) 88check_symbol_exists(PRIdMAX inttypes.h HAVE_INTTYPES_H)
111check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH) 89check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH)