diff options
author | 2015-10-19 20:23:12 +0000 | |
---|---|---|
committer | 2015-10-20 16:36:34 +0000 | |
commit | e70fb66ae033981144bed6af533fd800c281d6b7 (patch) | |
tree | b28639281201fe0f8feae8c002bd6dd29c2865f6 /src | |
parent | 49ceb1b6c3d57af1dea95af999f963501efd3668 (diff) |
Allow relative CxxBuiltinDirectories not just under crosstool or sysroot.
cxx_builtin_include directories which start with "%workspace%/" are taken
to be relative to the build workspace, and not relative to crosstool-top.
RELNOTES[NEW]: cpxx_builtin_include_directory specifications allow more flexibility.
--
MOS_MIGRATED_REVID=105789270
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java | 3 |
1 files changed, 3 insertions, 0 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 765387fc18..80f1644ece 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 @@ -849,6 +849,7 @@ public class CppConfiguration extends BuildConfiguration.Fragment { } private static final PathFragment SYSROOT_FRAGMENT = new PathFragment("%sysroot%"); + private static final PathFragment WORKSPACE_FRAGMENT = new PathFragment("%workspace%"); /** * Resolve the given include directory. If it is not absolute, it is @@ -867,6 +868,8 @@ public class CppConfiguration extends BuildConfiguration.Fragment { + "default_sysroot option is set"); } return sysroot.getRelative(path.relativeTo(SYSROOT_FRAGMENT)); + } else if (path.startsWith(WORKSPACE_FRAGMENT)) { + return path.subFragment(1, path.segmentCount()); } else { return crosstoolTopPathFragment.getRelative(path); } |