Skip to content

Commit 3e21df2

Browse files
authored
Merge pull request #437 from tweag/fix-add-resource-share-dir
Add clang resource share directory to search path
2 parents ff70910 + 5200c9b commit 3e21df2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

toolchains/cc/cc.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ pkgs.runCommand "bazel-${cc.orignalName or cc.name}-toolchain"
143143
| xargs -0 -r realpath -ms
144144
}
145145
CXX_BUILTIN_INCLUDE_DIRECTORIES=($({
146+
if is_compiler_option_supported -print-resource-dir; then
147+
resource_dir="$( $cc -print-resource-dir )"
148+
if [ -d "$resource_dir/share" ]; then
149+
echo "$resource_dir/share"
150+
fi
151+
fi
146152
include_dirs_for c
147153
include_dirs_for c++
148154
if is_compiler_option_supported -fno-canonical-system-headers; then

0 commit comments

Comments
 (0)