Changeset View
Changeset View
Standalone View
Standalone View
kde-modules/KDECompilerSettings.cmake
Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Line(s) | |||||
189 | # Pick sensible versions of the C and C++ standards. | 189 | # Pick sensible versions of the C and C++ standards. | ||
190 | # Note that MSVC does not have equivalent flags; the features are either | 190 | # Note that MSVC does not have equivalent flags; the features are either | ||
191 | # supported or they are not. | 191 | # supported or they are not. | ||
192 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") | 192 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") | ||
193 | # We use the C89 standard because that is what is common to all our | 193 | # We use the C89 standard because that is what is common to all our | ||
194 | # compilers (in particular, MSVC 2010 does not support C99) | 194 | # compilers (in particular, MSVC 2010 does not support C99) | ||
195 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=iso9899:1990") | 195 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=iso9899:1990") | ||
196 | endif() | 196 | endif() | ||
197 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | 197 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")) | ||
198 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") | 198 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") | ||
199 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32) | 199 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32) | ||
200 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") | 200 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") | ||
201 | endif() | 201 | endif() | ||
202 | 202 | | |||
203 | # Do not merge uninitialized global variables. | 203 | # Do not merge uninitialized global variables. | ||
204 | # This is mostly a "principle of least surprise" thing, but also | 204 | # This is mostly a "principle of least surprise" thing, but also | ||
205 | # has performance benefits. | 205 | # has performance benefits. | ||
206 | # See https://www.ibm.com/developerworks/community/blogs/zTPF/entry/benefits_of_the_fnocommon_compile_option_peter_lemieszewski?lang=en | 206 | # See https://www.ibm.com/developerworks/community/blogs/zTPF/entry/benefits_of_the_fnocommon_compile_option_peter_lemieszewski?lang=en | ||
207 | # Note that this only applies to C code; C++ already behaves like this. | 207 | # Note that this only applies to C code; C++ already behaves like this. | ||
208 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR | 208 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR | ||
209 | CMAKE_C_COMPILER_ID MATCHES "Clang" OR | 209 | CMAKE_C_COMPILER_ID MATCHES "Clang" OR | ||
210 | (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)) | 210 | (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)) | ||
211 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-common") | 211 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-common") | ||
212 | endif() | 212 | endif() | ||
213 | 213 | | |||
214 | # Do not treat the operator name keywords and, bitand, bitor, compl, not, or and xor as synonyms as keywords. | 214 | # Do not treat the operator name keywords and, bitand, bitor, compl, not, or and xor as synonyms as keywords. | ||
215 | # They're not supported under Visual Studio out of the box thus using them limits the portability of code | 215 | # They're not supported under Visual Studio out of the box thus using them limits the portability of code | ||
216 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR | 216 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR | ||
217 | CMAKE_C_COMPILER_ID MATCHES "Clang" OR | 217 | (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC") OR | ||
218 | (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)) | 218 | (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)) | ||
219 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-operator-names") | 219 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-operator-names") | ||
220 | endif() | 220 | endif() | ||
221 | 221 | | |||
222 | # Default to hidden visibility for symbols | 222 | # Default to hidden visibility for symbols | ||
223 | set(CMAKE_C_VISIBILITY_PRESET hidden) | 223 | set(CMAKE_C_VISIBILITY_PRESET hidden) | ||
224 | set(CMAKE_CXX_VISIBILITY_PRESET hidden) | 224 | set(CMAKE_CXX_VISIBILITY_PRESET hidden) | ||
225 | set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) | 225 | set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) | ||
Show All 32 Lines | |||||
258 | # TODO: Deal with QT_NO_EXCEPTIONS for non-gnu compilers? | 258 | # TODO: Deal with QT_NO_EXCEPTIONS for non-gnu compilers? | ||
259 | # This should be defined if and only if exceptions are disabled. | 259 | # This should be defined if and only if exceptions are disabled. | ||
260 | # qglobal.h has some magic to set it when exceptions are disabled | 260 | # qglobal.h has some magic to set it when exceptions are disabled | ||
261 | # with gcc, but other compilers are unaccounted for. | 261 | # with gcc, but other compilers are unaccounted for. | ||
262 | 262 | | |||
263 | # Turn off exceptions by default | 263 | # Turn off exceptions by default | ||
264 | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | 264 | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
265 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") | 265 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") | ||
266 | elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | 266 | elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC") | ||
267 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") | 267 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") | ||
268 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32) | 268 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32) | ||
269 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") | 269 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") | ||
270 | #elseif (MSVC OR (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")) | 270 | #elseif (MSVC OR (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")) | ||
271 | # Exceptions appear to be disabled by default for MSVC | 271 | # Exceptions appear to be disabled by default for MSVC | ||
272 | # http://msdn.microsoft.com/en-us/library/1deeycx5.aspx | 272 | # http://msdn.microsoft.com/en-us/library/1deeycx5.aspx | ||
273 | 273 | | |||
274 | # FIXME: are exceptions disabled by default for Intel? | 274 | # FIXME: are exceptions disabled by default for Intel? | ||
275 | endif() | 275 | endif() | ||
276 | 276 | | |||
277 | macro(_kdecompilersettings_append_exception_flag VAR) | 277 | macro(_kdecompilersettings_append_exception_flag VAR) | ||
278 | if (MSVC) | 278 | if (MSVC) | ||
279 | set(${VAR} "${${VAR}} -EHsc") | 279 | set(${VAR} "${${VAR}} -EHsc") | ||
280 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") | 280 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") | ||
281 | if (WIN32) | 281 | if (WIN32) | ||
282 | set(${VAR} "${${VAR}} -EHsc") | 282 | set(${VAR} "${${VAR}} -EHsc") | ||
283 | else() | 283 | else() | ||
284 | set(${VAR} "${${VAR}} -fexceptions") | 284 | set(${VAR} "${${VAR}} -fexceptions") | ||
285 | endif() | 285 | endif() | ||
286 | elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | 286 | elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
287 | set(${VAR} "${${VAR}} -fexceptions") | 287 | set(${VAR} "${${VAR}} -fexceptions") | ||
288 | elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | 288 | elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC") | ||
289 | set(${VAR} "${${VAR}} -fexceptions") | 289 | set(${VAR} "${${VAR}} -fexceptions") | ||
290 | endif() | 290 | endif() | ||
291 | string(STRIP "${${VAR}}" ${VAR}) | 291 | string(STRIP "${${VAR}}" ${VAR}) | ||
292 | endmacro() | 292 | endmacro() | ||
293 | 293 | | |||
294 | function(KDE_SOURCE_FILES_ENABLE_EXCEPTIONS) | 294 | function(KDE_SOURCE_FILES_ENABLE_EXCEPTIONS) | ||
295 | foreach(source_file ${ARGV}) | 295 | foreach(source_file ${ARGV}) | ||
296 | get_source_file_property(flags ${source_file} COMPILE_FLAGS) | 296 | get_source_file_property(flags ${source_file} COMPILE_FLAGS) | ||
297 | if(NOT flags) | 297 | if(NOT flags) | ||
298 | # If COMPILE_FLAGS is not set, get_source_file_property() sets it to | 298 | # If COMPILE_FLAGS is not set, get_source_file_property() sets it to | ||
299 | # NOTFOUND, which breaks build if we concatenate anything to | 299 | # NOTFOUND, which breaks build if we concatenate anything to | ||
300 | # the "NOTFOUND" string. | 300 | # the "NOTFOUND" string. | ||
301 | # Note that NOTFOUND evaluates to False, so we do enter the if. | 301 | # Note that NOTFOUND evaluates to False, so we do enter the if. | ||
302 | set(flags "") | 302 | set(flags "") | ||
303 | endif() | 303 | endif() | ||
304 | _kdecompilersettings_append_exception_flag(flags) | 304 | _kdecompilersettings_append_exception_flag(flags) | ||
305 | set_source_files_properties(${source_file} COMPILE_FLAGS "${flags}") | 305 | set_source_files_properties(${source_file} COMPILE_FLAGS "${flags}") | ||
306 | endforeach() | 306 | endforeach() | ||
307 | endfunction() | 307 | endfunction() | ||
308 | 308 | | |||
309 | function(KDE_TARGET_ENABLE_EXCEPTIONS target mode) | 309 | function(KDE_TARGET_ENABLE_EXCEPTIONS target mode) | ||
310 | target_compile_options(${target} ${mode} "$<$<CXX_COMPILER_ID:MSVC>:-EHsc>") | 310 | target_compile_options(${target} ${mode} "$<$<CXX_COMPILER_ID:MSVC>:-EHsc>") | ||
311 | if (WIN32) | 311 | if (WIN32) | ||
312 | target_compile_options(${target} ${mode} "$<$<CXX_COMPILER_ID:Intel>:-EHsc>") | 312 | target_compile_options(${target} ${mode} "$<$<OR:$<$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:Intel>>:-EHsc>") | ||
313 | else() | 313 | else() | ||
314 | target_compile_options(${target} ${mode} "$<$<CXX_COMPILER_ID:Intel>:-fexceptions>") | 314 | target_compile_options(${target} ${mode} "$<$<CXX_COMPILER_ID:Intel>:-fexceptions>") | ||
315 | endif() | 315 | endif() | ||
316 | if (NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")) | ||||
316 | target_compile_options(${target} ${mode} | 317 | target_compile_options(${target} ${mode} | ||
317 | "$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-fexceptions>") | 318 | "$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-fexceptions>") | ||
319 | endif() | ||||
318 | endfunction() | 320 | endfunction() | ||
319 | 321 | | |||
320 | function(KDE_ENABLE_EXCEPTIONS) | 322 | function(KDE_ENABLE_EXCEPTIONS) | ||
321 | # We set CMAKE_CXX_FLAGS, rather than add_compile_options(), because | 323 | # We set CMAKE_CXX_FLAGS, rather than add_compile_options(), because | ||
322 | # we only want to affect the compilation of C++ source files. | 324 | # we only want to affect the compilation of C++ source files. | ||
323 | 325 | | |||
324 | # strip any occurrences of -DQT_NO_EXCEPTIONS; this should only be defined | 326 | # strip any occurrences of -DQT_NO_EXCEPTIONS; this should only be defined | ||
325 | # if exceptions are disabled | 327 | # if exceptions are disabled | ||
Show All 10 Lines | |||||
336 | 338 | | |||
337 | 339 | | |||
338 | 340 | | |||
339 | ############################################################ | 341 | ############################################################ | ||
340 | # Better diagnostics (warnings, errors) | 342 | # Better diagnostics (warnings, errors) | ||
341 | ############################################################ | 343 | ############################################################ | ||
342 | 344 | | |||
343 | if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT APPLE) OR | 345 | if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT APPLE) OR | ||
344 | (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT APPLE) OR | 346 | (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT APPLE AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC") OR | ||
345 | (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)) | 347 | (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)) | ||
346 | # Linker warnings should be treated as errors | 348 | # Linker warnings should be treated as errors | ||
347 | set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_SHARED_LINKER_FLAGS}") | 349 | set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_SHARED_LINKER_FLAGS}") | ||
348 | set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_MODULE_LINKER_FLAGS}") | 350 | set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings ${CMAKE_MODULE_LINKER_FLAGS}") | ||
349 | 351 | | |||
350 | # Do not allow undefined symbols, even in non-symbolic shared libraries | 352 | # Do not allow undefined symbols, even in non-symbolic shared libraries | ||
351 | set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}") | 353 | set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}") | ||
352 | set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_MODULE_LINKER_FLAGS}") | 354 | set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_MODULE_LINKER_FLAGS}") | ||
353 | endif() | 355 | endif() | ||
354 | 356 | | |||
355 | set(_KDE_GCC_COMMON_WARNING_FLAGS "-Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef") | 357 | set(_KDE_GCC_COMMON_WARNING_FLAGS "-Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef") | ||
356 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | 358 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC") | ||
357 | # -Wgnu-zero-variadic-macro-arguments (part of -pedantic) is triggered by every qCDebug() call and therefore results | 359 | # -Wgnu-zero-variadic-macro-arguments (part of -pedantic) is triggered by every qCDebug() call and therefore results | ||
358 | # in a lot of noise. This warning is only notifying us that clang is emulating the GCC behaviour | 360 | # in a lot of noise. This warning is only notifying us that clang is emulating the GCC behaviour | ||
359 | # instead of the exact standard wording so we can safely ignore it | 361 | # instead of the exact standard wording so we can safely ignore it | ||
360 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments") | 362 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments") | ||
361 | endif() | 363 | endif() | ||
362 | if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") | 364 | if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") | ||
363 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_KDE_GCC_COMMON_WARNING_FLAGS} -Wmissing-format-attribute -Wwrite-strings") | 365 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_KDE_GCC_COMMON_WARNING_FLAGS} -Wmissing-format-attribute -Wwrite-strings") | ||
364 | # Make some warnings errors | 366 | # Make some warnings errors | ||
365 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration") | 367 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration") | ||
366 | endif() | 368 | endif() | ||
367 | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | 369 | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")) | ||
368 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_KDE_GCC_COMMON_WARNING_FLAGS} -Wnon-virtual-dtor -Woverloaded-virtual") | 370 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_KDE_GCC_COMMON_WARNING_FLAGS} -Wnon-virtual-dtor -Woverloaded-virtual") | ||
369 | # Make some warnings errors | 371 | # Make some warnings errors | ||
370 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type") | 372 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type") | ||
371 | endif() | 373 | endif() | ||
372 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR | 374 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR | ||
373 | (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)) | 375 | (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)) | ||
374 | # -Wvla: use of variable-length arrays (an extension to C++) | 376 | # -Wvla: use of variable-length arrays (an extension to C++) | ||
375 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wvla") | 377 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wvla") | ||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 487 | if (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | |||
489 | # some depending targets could not be build" | 491 | # some depending targets could not be build" | ||
490 | # FIXME: do our export macros not deal with this properly? | 492 | # FIXME: do our export macros not deal with this properly? | ||
491 | set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols") | 493 | set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols") | ||
492 | set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--export-all-symbols") | 494 | set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--export-all-symbols") | ||
493 | endif() | 495 | endif() | ||
494 | 496 | | |||
495 | if (CMAKE_GENERATOR STREQUAL "Ninja" AND | 497 | if (CMAKE_GENERATOR STREQUAL "Ninja" AND | ||
496 | ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) OR | 498 | ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) OR | ||
497 | (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5))) | 499 | (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5 AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC"))) | ||
498 | # Force colored warnings in Ninja's output, if the compiler has -fdiagnostics-color support. | 500 | # Force colored warnings in Ninja's output, if the compiler has -fdiagnostics-color support. | ||
499 | # Rationale in https://github.com/ninja-build/ninja/issues/814 | 501 | # Rationale in https://github.com/ninja-build/ninja/issues/814 | ||
500 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always") | 502 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always") | ||
501 | endif() | 503 | endif() | ||
502 | 504 | | |||
503 | include("${ECM_MODULE_DIR}/ECMEnableSanitizers.cmake") | 505 | include("${ECM_MODULE_DIR}/ECMEnableSanitizers.cmake") | ||
504 | include("${ECM_MODULE_DIR}/ECMCoverageOption.cmake") | 506 | include("${ECM_MODULE_DIR}/ECMCoverageOption.cmake") |