From 116f6db8fa6caa1f1cc7470d7f5a0d0e32b5352d Mon Sep 17 00:00:00 2001 From: Marcel Hlopko Date: Mon, 8 Jul 2024 11:06:59 +0200 Subject: [PATCH] Update bindgen.bzl to use toolchain system include directories as well (#2727) This is needed when using toolchains that use custom include directories. --- bindgen/private/bindgen.bzl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bindgen/private/bindgen.bzl b/bindgen/private/bindgen.bzl index 3be192de81..8606cac9c1 100644 --- a/bindgen/private/bindgen.bzl +++ b/bindgen/private/bindgen.bzl @@ -220,7 +220,10 @@ def _rust_bindgen_impl(ctx): feature_configuration = feature_configuration, include_directories = cc_lib[CcInfo].compilation_context.includes, quote_include_directories = cc_lib[CcInfo].compilation_context.quote_includes, - system_include_directories = cc_lib[CcInfo].compilation_context.system_includes, + system_include_directories = depset( + transitive = [cc_lib[CcInfo].compilation_context.system_includes], + direct = cc_toolchain.built_in_include_directories, + ), user_compile_flags = ctx.attr.clang_flags, ) compile_flags = cc_common.get_memory_inefficient_command_line(