diff options
author | 2015-07-21 21:17:41 +0000 | |
---|---|---|
committer | 2015-07-23 10:58:59 +0000 | |
commit | d8604856a4a64e978cb0ba428797bfdcf691bc87 (patch) | |
tree | dccd83f36021f6bb20d7a0b405b9c317247950f0 /src/main/java/com | |
parent | a8414f52a45ca8be3c89184d59f010650e9b0aba (diff) |
Support for .s, .S, and .asm files for objc rules
--
MOS_MIGRATED_REVID=98772452
Diffstat (limited to 'src/main/java/com')
3 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/MutableActionGraph.java b/src/main/java/com/google/devtools/build/lib/actions/MutableActionGraph.java index dde7e2e43e..24b53cfb1a 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/MutableActionGraph.java +++ b/src/main/java/com/google/devtools/build/lib/actions/MutableActionGraph.java @@ -70,7 +70,8 @@ public interface MutableActionGraph extends ActionGraph { public ActionConflictException(Artifact artifact, Action previousAction, Action attemptedAction) { - super("for " + artifact); + super(String.format("for %s, previous action: %s, attempted action: %s", + artifact, previousAction, attemptedAction)); this.artifact = artifact; this.previousAction = previousAction; this.attemptedAction = attemptedAction; diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java index 0c1088c7b8..55ed996395 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java @@ -195,6 +195,9 @@ final class CompilationSupport { if (ObjcRuleClasses.CPP_SOURCES.matches(sourceFile.getExecPath())) { commandLine.add("-stdlib=libc++"); } + if (ObjcRuleClasses.PREPROCESSED_ASSEMBLY_SOURCES.matches(sourceFile.getExecPath())) { + commandLine.add("-x").add("assembler-with-cpp"); + } if (compilationArtifacts.hasSwiftSources()) { // Add the directory that contains merged TargetName-Swift.h header to search path, in case diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java index 02d3566135..87361921fb 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java @@ -327,11 +327,14 @@ public class ObjcRuleClasses { */ static final FileType CPP_SOURCES = FileType.of(".cc", ".cpp", ".mm", ".cxx", ".C"); - static final FileType SWIFT_SOURCES = FileType.of(".swift"); + private static final FileType NON_CPP_SOURCES = FileType.of(".m", ".c", ".s", ".asm"); - private static final FileType NON_CPP_SOURCES = FileType.of(".m", ".c"); + static final FileType PREPROCESSED_ASSEMBLY_SOURCES = FileType.of(".S"); + + static final FileType SWIFT_SOURCES = FileType.of(".swift"); - static final FileTypeSet SRCS_TYPE = FileTypeSet.of(NON_CPP_SOURCES, CPP_SOURCES, SWIFT_SOURCES); + static final FileTypeSet SRCS_TYPE = FileTypeSet.of(NON_CPP_SOURCES, CPP_SOURCES, + PREPROCESSED_ASSEMBLY_SOURCES, SWIFT_SOURCES); static final FileTypeSet NON_ARC_SRCS_TYPE = FileTypeSet.of(FileType.of(".m", ".mm")); |