Skip to content

Commit d89fed1

Browse files
committed
Fix Sun C invocation from CMake.
cc: Can not use -xc99 with -pedantic (cherry picked from commit b298582)
1 parent 50a432c commit d89fed1

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
@@ -1043,7 +1043,13 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel)
10431043
check_and_add_compiler_option(-Wmissing-prototypes)
10441044
check_and_add_compiler_option(-Wmissing-variable-declarations)
10451045
check_and_add_compiler_option(-Wold-style-definition)
1046-
check_and_add_compiler_option(-Wpedantic)
1046+
if(NOT CMAKE_C_COMPILER_ID MATCHES "Sun")
1047+
# In Sun C versions that implement GCC compatibility "-Wpedantic"
1048+
# means the same as "-pedantic". The latter is mutually exclusive
1049+
# with several other options. One of those is "-xc99", which has
1050+
# already been set for Sun C above.
1051+
check_and_add_compiler_option(-Wpedantic)
1052+
endif()
10471053
check_and_add_compiler_option(-Wpointer-arith)
10481054
check_and_add_compiler_option(-Wpointer-sign)
10491055
check_and_add_compiler_option(-Wshadow)

0 commit comments

Comments
 (0)