Skip to content

Commit 3f0d63b

Browse files
committed
Use internal CMake compiler version directly
1 parent 524234e commit 3f0d63b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/lib_json/CMakeLists.txt

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
2-
#Get compiler version.
3-
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
4-
OUTPUT_VARIABLE GNUCXX_VERSION
5-
)
6-
1+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.1.2)
72
#-Werror=* was introduced -after- GCC 4.1.2
8-
if(GNUCXX_VERSION VERSION_GREATER 4.1.2)
9-
add_compile_options("-Werror=strict-aliasing")
10-
endif()
3+
add_compile_options("-Werror=strict-aliasing")
114
endif()
125

136
include(CheckIncludeFileCXX)

0 commit comments

Comments
 (0)