warn about problematic compiler versions and C++ standard combinations
This commit is contained in:
@ -164,6 +164,22 @@ if(MSVC)
|
|||||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# warn about potentially problematic GCC compiler versions
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
if (CMAKE_CXX_STANDARD GREATER_EQUAL 17)
|
||||||
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
|
||||||
|
message(WARNING "Using ${CMAKE_CXX_COMPILER_ID} compiler version ${CMAKE_CXX_COMPILER_VERSION} "
|
||||||
|
"with C++17 is not recommended. Please use ${CMAKE_CXX_COMPILER_ID} compiler version 9.x or later")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if (CMAKE_CXX_STANDARD GREATER_EQUAL 11)
|
||||||
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||||
|
message(WARNING "Using ${CMAKE_CXX_COMPILER_ID} compiler version ${CMAKE_CXX_COMPILER_VERSION} "
|
||||||
|
"with C++11 is not recommended. Please use ${CMAKE_CXX_COMPILER_ID} compiler version 5.x or later")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# export all symbols when building a .dll file on windows
|
# export all symbols when building a .dll file on windows
|
||||||
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND BUILD_SHARED_LIBS)
|
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND BUILD_SHARED_LIBS)
|
||||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||||
|
|||||||
Reference in New Issue
Block a user