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()
242
242
243
243
include (TryAppendCFlags )
244
244
if (MSVC )
245
- # Keep the following commands ordered lexicographically .
245
+ # For both cl and clang-cl compilers .
246
246
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.
247
254
try_append_c_flags (/wd4146 ) # Disable warning C4146 "unary minus operator applied to unsigned type, result still unsigned".
248
255
try_append_c_flags (/wd4244 ) # Disable warning C4244 "'conversion' conversion from 'type1' to 'type2', possible loss of data".
249
256
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 )
252
257
else ()
253
258
# Keep the following commands ordered lexicographically.
254
259
try_append_c_flags (-pedantic )
255
- try_append_c_flags (-Wall ) # GCC >= 2.95 and probably many other compilers.
256
260
try_append_c_flags (-Wcast-align ) # GCC >= 2.95.
257
261
try_append_c_flags (-Wcast-align=strict ) # GCC >= 8.0.
258
262
try_append_c_flags (-Wconditional-uninitialized ) # Clang >= 3.0 only.
You can’t perform that action at this time.
0 commit comments