File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,9 +19,20 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1919
2020# Enhance error reporting and compiler messages
2121if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" )
22- add_compile_options (-fcolor-diagnostics )
22+ if (WIN32 )
23+ # On Windows cuda nvcc uses cl and not clang
24+ add_compile_options ($<$<COMPILE_LANGUAGE :C >:-fcolor -diagnostics > $<$<COMPILE_LANGUAGE :CXX >:-fcolor -diagnostics >)
25+ else ()
26+ add_compile_options (-fcolor-diagnostics )
27+ endif ()
2328elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
24- add_compile_options (-fdiagnostics-color=always )
29+ if (WIN32 )
30+ # On Windows cuda nvcc uses cl and not gcc
31+ add_compile_options ($<$<COMPILE_LANGUAGE :C >:-fdiagnostics -color =always >
32+ $<$<COMPILE_LANGUAGE :CXX >:-fdiagnostics -color =always >)
33+ else ()
34+ add_compile_options (-fdiagnostics-color=always )
35+ endif ()
2536elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND MSVC_VERSION GREATER 1900)
2637 add_compile_options (/diagnostics:column )
2738else ()
You can’t perform that action at this time.
0 commit comments