aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar hlopko <hlopko@google.com>2018-06-07 01:15:01 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-07 01:16:34 -0700
commit5146ce0da00ea12f1730b7036e8e9f42d3561477 (patch)
tree62c270f54c4252fe1ea4b9a0ae049af5607db607 /tools
parentd0982b905d93e219a0caccdcf5d6ae1e219387c2 (diff)
Expose C++ action names to Skylark
This cl adds Skylark constants allowing users to specify which C++ action they want for the feature configuration Skylark API. This is done by exposing a Skylark file at @bazel_tools//tools/cpp:action_names.bzl. Skylark api to the C++ toolchain doc: https://docs.google.com/document/d/1g91BWJITcYw_X-VxsDC0VgUn5E9g0kRBGoBSpoO41gA/edit#. Progress on #4571. RELNOTES: None. PiperOrigin-RevId: 199596778
Diffstat (limited to 'tools')
-rw-r--r--tools/BUILD2
-rw-r--r--tools/build_defs/cc/BUILD12
-rw-r--r--tools/build_defs/cc/action_names.bzl66
3 files changed, 80 insertions, 0 deletions
diff --git a/tools/BUILD b/tools/BUILD
index 04e77109fe..0f28085e75 100644
--- a/tools/BUILD
+++ b/tools/BUILD
@@ -11,6 +11,7 @@ filegroup(
"//tools/bash:srcs",
"//tools/buildstamp:srcs",
"//tools/build_defs/apple:srcs",
+ "//tools/build_defs/cc:srcs",
"//tools/build_defs/apple/test:srcs",
"//tools/build_defs/docker:srcs",
"//tools/build_defs/hash:srcs",
@@ -44,6 +45,7 @@ filegroup(
"//tools/android:embedded_tools",
"//tools/bash:embedded_tools",
"//tools/build_defs/apple:srcs",
+ "//tools/build_defs/cc:srcs",
"//tools/build_defs/hash:srcs",
"//tools/build_defs/pkg:srcs",
"//tools/build_defs/repo:srcs",
diff --git a/tools/build_defs/cc/BUILD b/tools/build_defs/cc/BUILD
new file mode 100644
index 0000000000..9405d4a0d4
--- /dev/null
+++ b/tools/build_defs/cc/BUILD
@@ -0,0 +1,12 @@
+licenses(["notice"]) # Apache 2.0
+
+exports_files(["action_names.bzl"])
+
+filegroup(
+ name = "srcs",
+ srcs = glob(["**"]),
+ visibility = [
+ "//:__pkg__",
+ "//tools:__pkg__",
+ ],
+)
diff --git a/tools/build_defs/cc/action_names.bzl b/tools/build_defs/cc/action_names.bzl
new file mode 100644
index 0000000000..53061c48d3
--- /dev/null
+++ b/tools/build_defs/cc/action_names.bzl
@@ -0,0 +1,66 @@
+# Copyright 2018 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Constants for action names used for C++ rules."""
+
+# Name for the C compilation action.
+C_COMPILE_ACTION_NAME = "c-compile"
+
+# Name of the C++ compilation action.
+CPP_COMPILE_ACTION_NAME = "c++-compile"
+
+# Name of the linkstamp-compile action.
+LINKSTAMP_COMPILE_ACTION_NAME = "linkstamp-compile"
+
+# Name of the action used to compute CC_FLAGS make variable.
+CC_FLAGS_MAKE_VARIABLE_ACTION_NAME_ACTION_NAME = "cc-flags-make-variable"
+
+# Name of the C++ module codegen action.
+CPP_MODULE_CODEGEN_ACTION_NAME = "c++-module-codegen"
+
+# Name of the C++ header parsing action.
+CPP_HEADER_PARSING_ACTION_NAME = "c++-header-parsing"
+
+# Name of the C++ header preprocessing action.
+CPP_HEADER_PREPROCESSING_ACTION_NAME = "c++-header-preprocessing"
+
+# Name of the C++ module compile action.
+CPP_MODULE_COMPILE_ACTION_NAME = "c++-module-compile"
+
+# Name of the assembler action.
+ASSEMBLE_ACTION_NAME = "assemble"
+
+# Name of the assembly preprocessing action.
+PREPROCESS_ASSEMBLE_ACTION_NAME = "preprocess-assemble"
+
+# Name of the action producing ThinLto index.
+LTO_INDEXING_ACTION_NAME = "lto-indexing"
+
+# Name of the action compiling lto bitcodes into native objects.
+LTO_BACKEND_ACTION_NAME = "lto-backend"
+
+# Name of the link action producing executable binary.
+CPP_LINK_EXECUTABLE_ACTION_NAME = "c++-link-executable"
+
+# Name of the link action producing dynamic library.
+CPP_LINK_DYNAMIC_LIBRARY_ACTION_NAME = "c++-link-dynamic-library"
+
+# Name of the link action producing dynamic library that doesn't include it's
+# transitive dependencies.
+CPP_LINK_NODEPS_DYNAMIC_LIBRARY_ACTION_NAME = "c++-link-nodeps-dynamic-library"
+
+# Name of the archiving action producing static library.
+CPP_LINK_STATIC_LIBRARY_ACTION_NAME = "c++-link-static-library"
+
+# Name of the action stripping the binary.
+STRIP_ACTION_NAME = "strip"