aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CppSource.java
diff options
context:
space:
mode:
authorGravatar Rumou Duan <rduan@google.com>2017-02-10 17:24:03 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2017-02-10 18:19:31 +0000
commit5490757be5e527df82eee5094a0f59c86a5de766 (patch)
tree6d75800e0348de7e3472dd37de75d467a65fb468 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppSource.java
parent762576e5e7a3ee0da39dbb24134cb8530cbb911e (diff)
Introduce CppCompileActionTemplate, which expands into a list of CppCompileActions that to be executed at execution time.
-- PiperOrigin-RevId: 147163077 MOS_MIGRATED_REVID=147163077
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppSource.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppSource.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppSource.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppSource.java
index 17ec8d0372..bc6ff4b6ac 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppSource.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppSource.java
@@ -22,7 +22,17 @@ import java.util.Map;
/** A source file that is an input to a c++ compilation. */
@AutoValue
-abstract class CppSource {
+public abstract class CppSource {
+
+ /**
+ * Types of sources.
+ */
+ public enum Type {
+ SOURCE,
+ HEADER,
+ CLIF_INPUT_PROTO,
+ }
+
/**
* Creates a {@code CppSource}.
*
@@ -30,9 +40,11 @@ abstract class CppSource {
* @param label the label from which this source arises in the build graph
* @param buildVariables build variables that should be used specifically in the compilation
* of this source
+ * @param type type of the source file.
*/
- static CppSource create(Artifact source, Label label, Map<String, String> buildVariables) {
- return new AutoValue_CppSource(source, label, buildVariables);
+ static CppSource create(Artifact source, Label label, Map<String, String> buildVariables,
+ Type type) {
+ return new AutoValue_CppSource(source, label, buildVariables, type);
}
/**
@@ -49,4 +61,9 @@ abstract class CppSource {
* Returns build variables to be used specifically in the compilation of this source.
*/
abstract Map<String, String> getBuildVariables();
+
+ /**
+ * Returns the type of this source.
+ */
+ abstract Type getType();
}