include(_Configure)
configure_init(${CMAKE_BINARY_DIR}/mem_config.h)
+add_compile_definitions(${GLOBAL_DEFINITIONS})
+# list(TRANSFORM) requires >=3.12
+string(REPLACE ";" " -D" GLOBAL_DEFINITION_FLAGS "${GLOBAL_DEFINITIONS}")
+set(GLOBAL_DEFINITION_FLAGS -D${GLOBAL_DEFINITION_FLAGS})
+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)
endif()
if(${ARGC} GREATER 1)
string(APPEND CMAKE_REQUIRED_FLAGS " ${ARGV2}")
endif()
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS ${GLOBAL_DEFINITION_FLAGS})
check_symbol_exists(${NAME} ${HEADER} ${HAVE})
cmake_pop_check_state()
endmacro()
if(${ARGC} GREATER 1)
string(APPEND CMAKE_REQUIRED_FLAGS " ${ARGN}")
endif()
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS ${GLOBAL_DEFINITION_FLAGS})
check_cxx_symbol_exists(${NAME} ${HEADER} ${HAVE})
cmake_pop_check_state()
endmacro()
if(${ARGC} GREATER 1)
string(APPEND CMAKE_REQUIRED_FLAGS " ${ARGN}")
endif()
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS ${GLOBAL_DEFINITION_FLAGS})
check_include_file(${HEADER} ${HAVE})
cmake_pop_check_state()
endmacro()
if(${ARGC} GREATER 1)
string(APPEND CMAKE_REQUIRED_FLAGS " ${ARGN}")
endif()
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS ${GLOBAL_DEFINITION_FLAGS})
check_include_file_cxx(${HEADER} ${HAVE})
cmake_pop_check_state()
endmacro()
if(${ARGC} GREATER 1)
list(APPEND CMAKE_EXTRA_INCLUDE_FILES ${ARGN})
endif()
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS ${GLOBAL_DEFINITION_FLAGS})
check_type_size(${TYPE} ${HAVE})
cmake_pop_check_state()
endmacro()
include(CheckCSourceCompiles)
macro(check_c_source SOURCE HAVE)
configure_define(${HAVE})
+ cmake_push_check_state()
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS ${GLOBAL_DEFINITION_FLAGS})
check_c_source_compiles("${SOURCE}" ${HAVE})
+ cmake_pop_check_state()
endmacro()
include(CheckCXXSourceCompiles)
macro(check_cxx_source SOURCE HAVE)
configure_define(${HAVE})
+ cmake_push_check_state()
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS ${GLOBAL_DEFINITION_FLAGS})
check_cxx_source_compiles("${SOURCE}" ${HAVE})
+ cmake_pop_check_state()
endmacro()
include(CheckBacktrace)