Skip to content

Commit b298582

Browse files
infrastationguyharris
authored andcommitted
Fix Sun C invocation from CMake.
cc: Can not use -xc99 with -pedantic
1 parent 5265743 commit b298582

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,13 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel)
10311031
check_and_add_compiler_option(-Wmissing-prototypes)
10321032
check_and_add_compiler_option(-Wmissing-variable-declarations)
10331033
check_and_add_compiler_option(-Wold-style-definition)
1034-
check_and_add_compiler_option(-Wpedantic)
1034+
if(NOT CMAKE_C_COMPILER_ID MATCHES "Sun")
1035+
# In Sun C versions that implement GCC compatibility "-Wpedantic"
1036+
# means the same as "-pedantic". The latter is mutually exclusive
1037+
# with several other options. One of those is "-xc99", which has
1038+
# already been set for Sun C above.
1039+
check_and_add_compiler_option(-Wpedantic)
1040+
endif()
10351041
check_and_add_compiler_option(-Wpointer-arith)
10361042
check_and_add_compiler_option(-Wpointer-sign)
10371043
check_and_add_compiler_option(-Wshadow)

0 commit comments

Comments
 (0)