Browse Source

Swift: Honor CMAKE_COLOR_DIAGNOSTICS for command-line build systems

Add the missing flags to enable and disable color diagnostics for Swift.

Fixes: #25815
Evan Wilde 1 year ago
parent
commit
ff7a09d719
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Modules/CMakeSwiftInformation.cmake

+ 2 - 0
Modules/CMakeSwiftInformation.cmake

@@ -57,6 +57,8 @@ set(CMAKE_Swift_LINK_LIBRARY_FLAG "-l")
 set(CMAKE_Swift_LINKER_WRAPPER_FLAG "-Xlinker" " ")
 set(CMAKE_Swift_RESPONSE_FILE_LINK_FLAG @)
 set(CMAKE_Swift_RESPONSE_FILE_FLAG @)
+set(CMAKE_Swift_COMPILE_OPTIONS_COLOR_DIAGNOSTICS -color-diagnostics)
+set(CMAKE_Swift_COMPILE_OPTIONS_COLOR_DIAGNOSTICS_OFF -no-color-diagnostics)
 
 set(CMAKE_Swift_LINKER_PREFERENCE 50)
 set(CMAKE_Swift_LINKER_PREFERENCE_PROPAGATES 1)