diff options
author | 2017-06-06 15:45:39 -0400 | |
---|---|---|
committer | 2017-06-07 09:49:13 -0400 | |
commit | 5f83d096af00f9d26696ad56481a1605c292a481 (patch) | |
tree | 63f9623ba1ef32263a5d4ed8e72facba8d2fa105 /src/main/java/com/google/devtools/build/lib/rules | |
parent | 7aacb779c8c2ee72a297bad9c82ba6872100ec17 (diff) |
Do not add archiver_flags feature when crosstool already has one.
This is needed for migrating one of the internal crosstools
RELNOTES: None.
PiperOrigin-RevId: 158176295
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionConfigs.java | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionConfigs.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionConfigs.java index 10fc419628..5fc511d11a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionConfigs.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionConfigs.java @@ -255,28 +255,27 @@ public class CppLinkActionConfigs { " }", " }", "}", - "feature {", - " name: 'archiver_flags'", - " flag_set {", - " expand_if_all_available: 'output_execpath'", - " action: 'c++-link-static-library'", - " action: 'c++-link-alwayslink-static-library'", - " action: 'c++-link-pic-static-library'", - " action: 'c++-link-alwayslink-pic-static-library'", - " flag_group {", - ifLinux( - platform, - " flag: 'rcsD'", - " flag: '%{output_execpath}'"), - ifMac( - platform, - " flag: '-static'", - " flag: '-s'", - " flag: '-o'", - " flag: '%{output_execpath}'"), - " }", - " }", - "}", + ifTrue( + !features.contains("archiver_flags"), + "feature {", + " name: 'archiver_flags'", + " flag_set {", + " expand_if_all_available: 'output_execpath'", + " action: 'c++-link-static-library'", + " action: 'c++-link-alwayslink-static-library'", + " action: 'c++-link-pic-static-library'", + " action: 'c++-link-alwayslink-pic-static-library'", + " flag_group {", + ifLinux(platform, " flag: 'rcsD'", " flag: '%{output_execpath}'"), + ifMac( + platform, + " flag: '-static'", + " flag: '-s'", + " flag: '-o'", + " flag: '%{output_execpath}'"), + " }", + " }", + "}"), "feature {", " name: 'libraries_to_link'", " flag_set {", |