aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
diff options
context:
space:
mode:
authorGravatar Cal Peyser <cpeyser@google.com>2017-03-01 19:39:08 +0000
committerGravatar Yue Gan <yueg@google.com>2017-03-02 13:32:00 +0000
commit7cc6c629c2475062bed3abca004c4fcfb9d4adb5 (patch)
treeea0a0d02377b2683b825b0db3a1349f1d4c3bf3a /src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
parent33093ca444d979dfcd81a56655d4e5dbbd1b35e9 (diff)
ios_test provides test-specific command line args when using the crosstool.
This requires passing linkopts through CrosstoolCompilationSupport into the 'legacy_link_flags' feature, as is done in c++. -- PiperOrigin-RevId: 148911500 MOS_MIGRATED_REVID=148911500
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
index bb3cdbdb79..82d2e26bc7 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
@@ -397,18 +397,6 @@ public final class LinkCommandLine extends CommandLine {
.build()));
break;
- case DYNAMIC_LIBRARY:
- argv.add(toolPath);
- argv.addAll(
- featureConfiguration.getCommandLine(
- actionName,
- new Variables.Builder()
- .addAll(variables)
- .addStringSequenceVariable(
- CppLinkActionBuilder.LEGACY_LINK_FLAGS_VARIABLE, getToolchainFlags())
- .build()));
- break;
-
case STATIC_LIBRARY:
case PIC_STATIC_LIBRARY:
case ALWAYS_LINK_STATIC_LIBRARY:
@@ -421,14 +409,23 @@ public final class LinkCommandLine extends CommandLine {
argv.addAll(featureConfiguration.getCommandLine(actionName, variables));
break;
- // Since the objc case is not hardcoded in CppConfiguration, we can use the actual tool.
- // TODO(b/30109612): make this pattern the case for all link variants.
+ // Since the objc case/dynamic libs is not hardcoded in CppConfiguration, we can use the
+ // actual tool.
+ // TODO(b/30109612): make this pattern the case for all link variants.
+ case DYNAMIC_LIBRARY:
case OBJC_ARCHIVE:
case OBJC_FULLY_LINKED_ARCHIVE:
case OBJC_EXECUTABLE:
case OBJCPP_EXECUTABLE:
argv.add(toolPath);
- argv.addAll(featureConfiguration.getCommandLine(actionName, variables));
+ argv.addAll(
+ featureConfiguration.getCommandLine(
+ actionName,
+ new Variables.Builder()
+ .addAll(variables)
+ .addStringSequenceVariable(
+ CppLinkActionBuilder.LEGACY_LINK_FLAGS_VARIABLE, getToolchainFlags())
+ .build()));
break;
default: