diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java | 3 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java | 9 |
2 files changed, 9 insertions, 3 deletions
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")); |