diff options
author | Googler <noreply@google.com> | 2015-09-16 15:38:10 +0000 |
---|---|---|
committer | Florian Weikert <fwe@google.com> | 2015-09-16 20:05:50 +0000 |
commit | 54b6920c3ffafd3a837a319de959c181a4320c7c (patch) | |
tree | b0f00a85614467650cc3ee9e528b48acf37e67c0 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java | |
parent | 46d6dc54fc5352b7e463494de4a82bdf2c5168fe (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=103196242
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java index a943057030..ab1196c1f7 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java @@ -382,13 +382,17 @@ public class CppCompileActionBuilder { } public CppCompileActionBuilder setDotdFile(PathFragment outputName, String extension) { - if (configuration.getFragment(CppConfiguration.class).getInmemoryDotdFiles()) { - // Just set the path, no artifact is constructed - PathFragment file = FileSystemUtils.replaceExtension(outputName, extension); - Root root = configuration.getBinDirectory(); - dotdFile = new DotdFile(root.getExecPath().getRelative(file)); + if (CppFileTypes.mustProduceDotdFile(outputName.toString())) { + if (configuration.getFragment(CppConfiguration.class).getInmemoryDotdFiles()) { + // Just set the path, no artifact is constructed + PathFragment file = FileSystemUtils.replaceExtension(outputName, extension); + Root root = configuration.getBinDirectory(); + dotdFile = new DotdFile(root.getExecPath().getRelative(file)); + } else { + dotdFile = new DotdFile(ruleContext.getRelatedArtifact(outputName, extension)); + } } else { - dotdFile = new DotdFile(ruleContext.getRelatedArtifact(outputName, extension)); + dotdFile = null; } return this; } |