aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2015-09-04 16:15:19 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-09-04 16:33:04 +0000
commita708acd02baf3821c975801ae0e5cad6867a6735 (patch)
tree1be391b7c9fa3df12cdf29412b2abe71f250de95 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
parentd416ffeac5e81630688e31b7925e287354195b60 (diff)
Teach Bazel to accept assembler-without-preprocessor source files.
Adding the accepted file extensions was a minor issue. The bulk of this change was to weaken the assertion that all cxx compiler actions produce a '.d' file. RELNOTES[NEW]: a cc_binary rule may list '.s' and '.asm' files in the srcs -- MOS_MIGRATED_REVID=102346882
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
index 655dcd5f1a..a7e3a1a1da 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
@@ -59,11 +59,12 @@ public final class CppFileTypes {
final String ext = ".s";
@Override
public boolean apply(String filename) {
- return filename.endsWith(ext) && !PIC_ASSEMBLER.matches(filename);
+ return (filename.endsWith(ext) && !PIC_ASSEMBLER.matches(filename))
+ || filename.endsWith(".asm");
}
@Override
public List<String> getExtensions() {
- return ImmutableList.of(ext);
+ return ImmutableList.of(ext, ".asm");
}
};
@@ -139,4 +140,8 @@ public final class CppFileTypes {
// Output of the dwp tool
public static final FileType DEBUG_INFO_PACKAGE = FileType.of(".dwp");
+
+ public static final boolean mustProduceDotdFile(String source) {
+ return !(ASSEMBLER.matches(source) || PIC_ASSEMBLER.matches(source));
+ }
}