Use internal CMake compiler version directly

This commit is contained in:
Joel Johnson 2020-02-18 13:56:26 -07:00
parent 524234e479
commit 3f0d63b5a9

View File

@ -1,13 +1,6 @@
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
#Get compiler version.
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
OUTPUT_VARIABLE GNUCXX_VERSION
)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.1.2)
#-Werror=* was introduced -after- GCC 4.1.2
if(GNUCXX_VERSION VERSION_GREATER 4.1.2)
add_compile_options("-Werror=strict-aliasing")
endif()
add_compile_options("-Werror=strict-aliasing")
endif()
include(CheckIncludeFileCXX)