aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java8
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java12
2 files changed, 14 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java
index 4cbc6cf8ce..67226586a6 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java
@@ -1435,7 +1435,13 @@ public class CcToolchainFeatures implements Serializable {
stringVariablesMap.putAll(variables.stringVariablesMap);
}
- /** Add a variable that expands {@code name} to {@code value}. */
+ /** Add an integer variable that expands {@code name} to {@code value}. */
+ public Builder addIntegerVariable(String name, int value) {
+ variablesMap.put(name, new IntegerValue(value));
+ return this;
+ }
+
+ /** Add a string variable that expands {@code name} to {@code value}. */
public Builder addStringVariable(String name, String value) {
Preconditions.checkArgument(
!variablesMap.containsKey(name), "Cannot overwrite variable '%s'", name);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java
index 0b34fb40b4..4e1d5f47ce 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java
@@ -134,9 +134,12 @@ public class CppLinkActionBuilder {
/** A build variable whose presence indicates that the debug symbols should be stripped. */
public static final String STRIP_DEBUG_SYMBOLS_VARIABLE = "strip_debug_symbols";
- /** A build variable whose presence indicates that this action is a cc_test linking action. */
+ @Deprecated
public static final String IS_CC_TEST_LINK_ACTION_VARIABLE = "is_cc_test_link_action";
+ /** A build variable whose presence indicates that this action is a cc_test linking action. */
+ public static final String IS_CC_TEST_VARIABLE = "is_cc_test";
+
/**
* Temporary build variable for migrating osx crosstool.
* TODO(b/37271982): Remove after blaze with ar action_config release
@@ -150,10 +153,7 @@ public class CppLinkActionBuilder {
*/
public static final String IS_USING_FISSION_VARIABLE = "is_using_fission";
- /**
- * A (temporary) build variable whose presence indicates that this action is not a cc_test linking
- * action.
- */
+ @Deprecated
public static final String IS_NOT_CC_TEST_LINK_ACTION_VARIABLE = "is_not_cc_test_link_action";
// Builder-only
@@ -1437,8 +1437,10 @@ public class CppLinkActionBuilder {
}
if (useTestOnlyFlags()) {
+ buildVariables.addIntegerVariable(IS_CC_TEST_VARIABLE, 1);
buildVariables.addStringVariable(IS_CC_TEST_LINK_ACTION_VARIABLE, "");
} else {
+ buildVariables.addIntegerVariable(IS_CC_TEST_VARIABLE, 0);
buildVariables.addStringVariable(IS_NOT_CC_TEST_LINK_ACTION_VARIABLE, "");
}