bjuild system/tests: check for <version> (old compilers support)

This commit is contained in:
Michele Caini
2022-02-13 18:31:26 +01:00
parent e51b1bbb25
commit df9301d591

View File

@@ -3,6 +3,12 @@
#
include(FetchContent)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include<version>
int main() { return 0; }
" ENTT_HAS_HEADER_VERSION)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
@@ -67,6 +73,14 @@ function(SETUP_TARGET TARGET_NAME)
NOMINMAX
${ARGN}
)
if(ENTT_HAS_HEADER_VERSION)
target_compile_definitions(
${TARGET_NAME}
PRIVATE
ENTT_HAS_HEADER_VERSION
)
endif()
endfunction()
add_library(odr OBJECT odr.cpp)