File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -242,17 +242,21 @@ endif()
242242
243243include (TryAppendCFlags)
244244if (MSVC )
245- # Keep the following commands ordered lexicographically .
245+ # For both cl and clang-cl compilers .
246246 try_append_c_flags(/W3) # Production quality warning level.
247+ # Eliminate deprecation warnings for the older, less secure functions.
248+ add_compile_definitions (_CRT_SECURE_NO_WARNINGS)
249+ else ()
250+ try_append_c_flags(-Wall) # GCC >= 2.95 and probably many other compilers.
251+ endif ()
252+ if (CMAKE_C_COMPILER_ID STREQUAL "MSVC" )
253+ # Keep the following commands ordered lexicographically.
247254 try_append_c_flags(/wd4146) # Disable warning C4146 "unary minus operator applied to unsigned type, result still unsigned".
248255 try_append_c_flags(/wd4244) # Disable warning C4244 "'conversion' conversion from 'type1' to 'type2', possible loss of data".
249256 try_append_c_flags(/wd4267) # Disable warning C4267 "'var' : conversion from 'size_t' to 'type', possible loss of data".
250- # Eliminate deprecation warnings for the older, less secure functions.
251- add_compile_definitions (_CRT_SECURE_NO_WARNINGS)
252257else ()
253258 # Keep the following commands ordered lexicographically.
254259 try_append_c_flags(-pedantic)
255- try_append_c_flags(-Wall) # GCC >= 2.95 and probably many other compilers.
256260 try_append_c_flags(-Wcast-align) # GCC >= 2.95.
257261 try_append_c_flags(-Wcast-align=strict) # GCC >= 8.0.
258262 try_append_c_flags(-Wconditional-uninitialized) # Clang >= 3.0 only.
You can’t perform that action at this time.
0 commit comments