diff options
author | hlopko <hlopko@google.com> | 2018-03-21 07:51:34 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-21 07:52:55 -0700 |
commit | 5cee7f4afbadf8f463b33cf47dcd2fde096c6a4b (patch) | |
tree | 488f63e5e33ff55ac186c78bb61805ebf0e23d0f /src/main/java/com/google/devtools/build/lib/rules/cpp | |
parent | 339b5e4c021a348f7c50cb2b2aaba4bb01644402 (diff) |
Automated rollback of commit 67549a752c2316234b19d7b50ea84a8ae80d3669.
*** Reason for rollback ***
Breaks on windows: https://www.google.com/url?sa=D&q=https%3A%2F%2Fbuildkite.com%2Fbazel%2Fgoogle-bazel-presubmit%2Fbuilds%2F624%234a68440b-948b-437b-a633-4f0595721bab
*** Original change description ***
Automated rollback of commit 3c5a1098af0c5ae80d4e3b1fc52dd1fef6027d43.
*** Reason for rollback ***
Breaks bazel ci: https://github.com/bazelbuild/bazel/issues/4894#event-1533040075
*** Original change description ***
Add crosstool_lib.bzl and crosstool_utils.bzl
These will be used to rewrite current crosstool autoconfiguration into
action_configs and features.
RELNOTES: None.
PiperOrigin-RevId: 189906675
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java index b25dc7fc85..a2da30d674 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java @@ -50,6 +50,7 @@ import com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.Variables; import com.google.devtools.build.lib.rules.cpp.CppConfiguration.DynamicMode; import com.google.devtools.build.lib.rules.cpp.CppConfiguration.HeadersCheckingMode; import com.google.devtools.build.lib.rules.cpp.FdoSupport.FdoMode; +import com.google.devtools.build.lib.rules.cpp.Link.LinkTargetType; import com.google.devtools.build.lib.shell.ShellUtils; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec.VisibleForSerialization; @@ -105,11 +106,8 @@ public final class CcCommon { } }; - /** Action configs we request to enable. */ - private static final ImmutableSet<String> DEFAULT_ACTION_CONFIGS = + public static final ImmutableSet<String> ALL_COMPILE_ACTIONS = ImmutableSet.of( - CppCompileAction.CC_FLAGS_MAKE_VARIABLE_ACTION_NAME, - CppCompileAction.STRIP_ACTION_NAME, CppCompileAction.C_COMPILE, CppCompileAction.CPP_COMPILE, CppCompileAction.CPP_HEADER_PARSING, @@ -120,16 +118,29 @@ public final class CcCommon { CppCompileAction.PREPROCESS_ASSEMBLE, CppCompileAction.CLIF_MATCH, CppCompileAction.LINKSTAMP_COMPILE, - Link.LinkTargetType.STATIC_LIBRARY.getActionName(), - // We need to create pic-specific actions for link actions, as they will produce - // differently named outputs. - Link.LinkTargetType.PIC_STATIC_LIBRARY.getActionName(), + CppCompileAction.CC_FLAGS_MAKE_VARIABLE_ACTION_NAME); + + public static final ImmutableSet<String> ALL_LINK_ACTIONS = + ImmutableSet.of( Link.LinkTargetType.INTERFACE_DYNAMIC_LIBRARY.getActionName(), - Link.LinkTargetType.NODEPS_DYNAMIC_LIBRARY.getActionName(), Link.LinkTargetType.DYNAMIC_LIBRARY.getActionName(), - Link.LinkTargetType.ALWAYS_LINK_STATIC_LIBRARY.getActionName(), - Link.LinkTargetType.ALWAYS_LINK_PIC_STATIC_LIBRARY.getActionName(), - Link.LinkTargetType.EXECUTABLE.getActionName()); + Link.LinkTargetType.NODEPS_DYNAMIC_LIBRARY.getActionName(), + LinkTargetType.EXECUTABLE.getActionName()); + + public static final ImmutableSet<String> ALL_ARCHIVE_ACTIONS = + ImmutableSet.of(Link.LinkTargetType.STATIC_LIBRARY.getActionName()); + + public static final ImmutableSet<String> ALL_OTHER_ACTIONS = + ImmutableSet.of(CppCompileAction.STRIP_ACTION_NAME); + + /** Action configs we request to enable. */ + public static final ImmutableSet<String> DEFAULT_ACTION_CONFIGS = + ImmutableSet.<String>builder() + .addAll(ALL_COMPILE_ACTIONS) + .addAll(ALL_LINK_ACTIONS) + .addAll(ALL_ARCHIVE_ACTIONS) + .addAll(ALL_OTHER_ACTIONS) + .build(); /** Features we request to enable unless a rule explicitly doesn't support them. */ private static final ImmutableSet<String> DEFAULT_FEATURES = @@ -142,6 +153,7 @@ public final class CcCommon { CppRuleClasses.INCLUDE_PATHS, CppRuleClasses.PIC, CppRuleClasses.PREPROCESSOR_DEFINES); + public static final String CC_TOOLCHAIN_DEFAULT_ATTRIBUTE_NAME = ":cc_toolchain"; /** C++ configuration */ |