diff options
author | 2016-09-01 17:42:14 +0000 | |
---|---|---|
committer | 2016-09-02 08:24:42 +0000 | |
commit | d9db4754a5b3d50ac50131d637140c07696567a2 (patch) | |
tree | 5ae419829e3fdbeb25175253c11285f5e5a1840f /src/main/java/com/google/devtools/build/lib | |
parent | 0162063be5295f708bc4e205c5a01ea7213e85e0 (diff) |
Adds support for experimental_objc_library.includes
--
MOS_MIGRATED_REVID=131965224
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java | 49 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibrary.java | 5 |
2 files changed, 31 insertions, 23 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java index 87e3e97ca0..d076040987 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java @@ -847,29 +847,32 @@ public class CppConfiguration extends BuildConfiguration.Fragment { toolchainBuilder); } if (!features.contains("include_paths")) { - TextFormat.merge("" - + "feature {" - + " name: 'include_paths'" - + " flag_set {" - + " action: 'preprocess-assemble'" - + " action: 'c-compile'" - + " action: 'c++-compile'" - + " action: 'c++-header-parsing'" - + " action: 'c++-header-preprocessing'" - + " action: 'c++-module-compile'" - + " flag_group {" - + " flag: '-iquote'" - + " flag: '%{quote_include_paths}'" - + " }" - + " flag_group {" - + " flag: '-I%{include_paths}'" - + " }" - + " flag_group {" - + " flag: '-isystem'" - + " flag: '%{system_include_paths}'" - + " }" - + " }" - + "}", + TextFormat.merge( + "" + + "feature {" + + " name: 'include_paths'" + + " flag_set {" + + " action: 'preprocess-assemble'" + + " action: 'c-compile'" + + " action: 'c++-compile'" + + " action: 'c++-header-parsing'" + + " action: 'c++-header-preprocessing'" + + " action: 'c++-module-compile'" + + " action: 'objc-compile'" + + " action: 'objc++-compile'" + + " flag_group {" + + " flag: '-iquote'" + + " flag: '%{quote_include_paths}'" + + " }" + + " flag_group {" + + " flag: '-I%{include_paths}'" + + " }" + + " flag_group {" + + " flag: '-isystem'" + + " flag: '%{system_include_paths}'" + + " }" + + " }" + + "}", toolchainBuilder); } if (!features.contains("fdo_instrument")) { diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibrary.java index 5e0b4835a1..79eff7b041 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibrary.java @@ -16,6 +16,8 @@ package com.google.devtools.build.lib.rules.objc; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.DEFINE; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.IMPORTED_LIBRARY; +import static com.google.devtools.build.lib.rules.objc.ObjcProvider.INCLUDE; +import static com.google.devtools.build.lib.rules.objc.ObjcProvider.INCLUDE_SYSTEM; import static com.google.devtools.build.lib.rules.objc.XcodeProductType.LIBRARY_STATIC; import com.google.common.collect.ImmutableList; @@ -107,6 +109,8 @@ public class ExperimentalObjcLibrary implements RuleConfiguredTargetFactory { .addPrecompiledFiles(precompiledFiles) .addDeps(ruleContext.getPrerequisites("deps", Mode.TARGET)) .addCopts(compilationSupport.getCompileRuleCopts()) + .addIncludeDirs(common.getObjcProvider().get(INCLUDE)) + .addSystemIncludeDirs(common.getObjcProvider().get(INCLUDE_SYSTEM)) .addVariableExtension(variablesExtension); if (compilationArtifacts.getArchive().isPresent()) { @@ -172,6 +176,7 @@ public class ExperimentalObjcLibrary implements RuleConfiguredTargetFactory { activatedCrosstoolSelectables.add(CppRuleClasses.MODULE_MAPS); activatedCrosstoolSelectables.add(CppRuleClasses.COMPILE_ACTION_FLAGS_IN_FLAG_SET); activatedCrosstoolSelectables.add(CppRuleClasses.DEPENDENCY_FILE); + activatedCrosstoolSelectables.add(CppRuleClasses.INCLUDE_PATHS); return toolchain.getFeatures().getFeatureConfiguration(activatedCrosstoolSelectables.build()); } |