diff options
author | Cal Peyser <cpeyser@google.com> | 2016-09-29 12:52:46 +0000 |
---|---|---|
committer | Yun Peng <pcloudy@google.com> | 2016-09-30 08:11:27 +0000 |
commit | 7de1f246b8cfe33bc848efce6eb5c8b41d937c91 (patch) | |
tree | 4200bc116534c7ab8aa9166487ec0e83aca9b6d1 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java | |
parent | ed3d837aec842d67a3165cf60e15aeb218ac50f0 (diff) |
cxx_flags are not applied to objc compiles.
--
MOS_MIGRATED_REVID=134651940
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java index c3c93864a8..2b6912e24c 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java @@ -132,7 +132,7 @@ public class CppCompileAction extends AbstractAction * A string constant for the objc++ compile action. */ public static final String OBJCPP_COMPILE = "objc++-compile"; - + /** * A string constant for the c++ header parsing. */ @@ -1341,6 +1341,10 @@ public class CppCompileAction extends AbstractAction return commandLine; } + private boolean isObjcCompile(String actionName) { + return (actionName.equals(OBJC_COMPILE) || actionName.equals(OBJCPP_COMPILE)); + } + public List<String> getCompilerOptions( @Nullable CcToolchainFeatures.Variables overwrittenVariables) { List<String> options = new ArrayList<>(); @@ -1383,7 +1387,9 @@ public class CppCompileAction extends AbstractAction // Unfiltered compiler options contain system include paths. These must be added after // the user provided options, otherwise users adding include paths will not pick up their // own include paths first. - options.addAll(toolchain.getUnfilteredCompilerOptions(features)); + if (!isObjcCompile(actionName)) { + options.addAll(toolchain.getUnfilteredCompilerOptions(features)); + } // Add the options of --per_file_copt, if the label or the base name of the source file // matches the specified regular expression filter. |