Skip to content

Commit 99341a7

Browse files
keithjrose-apple
authored andcommitted
Move color-diagnostics to Options.td (swiftlang#24144)
This allows us to mark this flag as DoesNotAffectIncrementalBuild, so that switching between a tty and non-tty doesn't cause full rebuilds with swiftpm. https://bugs.swift.org/browse/SR-7982
1 parent 0800819 commit 99341a7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ let Flags = [FrontendOption, NoDriverOption] in {
1818

1919
def triple : Separate<["-"], "triple">, Alias<target>;
2020

21-
def color_diagnostics : Flag<["-"], "color-diagnostics">,
22-
HelpText<"Print diagnostics in color">;
23-
2421
def primary_file : Separate<["-"], "primary-file">,
2522
HelpText<"Produce output for this file, not the whole module">;
2623

include/swift/Option/Options.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ def serialize_diagnostics_path : Separate<["-"], "serialize-diagnostics-path">,
300300
def serialize_diagnostics_path_EQ: Joined<["-"], "serialize-diagnostics-path=">,
301301
Flags<[FrontendOption, NoBatchOption, DoesNotAffectIncrementalBuild, ArgumentIsPath]>,
302302
Alias<serialize_diagnostics_path>;
303+
def color_diagnostics : Flag<["-"], "color-diagnostics">,
304+
Flags<[FrontendOption, DoesNotAffectIncrementalBuild]>,
305+
HelpText<"Print diagnostics in color">;
303306

304307
def module_cache_path : Separate<["-"], "module-cache-path">,
305308
Flags<[FrontendOption, DoesNotAffectIncrementalBuild, ArgumentIsPath]>,

test/Driver/color-diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not %target-swiftc_driver -Xfrontend -color-diagnostics -emit-executable -o %t %s 2>&1 | %FileCheck %s
1+
// RUN: not %target-swiftc_driver -color-diagnostics -emit-executable -o %t %s 2>&1 | %FileCheck %s
22

33
// CHECK: [0m1 = 2{{$}}
44
1 = 2

0 commit comments

Comments
 (0)