From bb58b65798ba43e8cfbe1ca393beef05a0085caf Mon Sep 17 00:00:00 2001 From: Jiacheng Lu Date: Fri, 13 Dec 2024 20:21:29 -0800 Subject: [PATCH] pw_rust: Enable GN pw_rust targets for linux host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Having GN rust build checked in CQ. - Fix a issue in bindgen Change-Id: I6c313dd95c3c83028f3555be2da075feb0428a3f Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/254372 Presubmit-Verified: CQ Bot Account Commit-Queue: Jiacheng Lu Reviewed-by: Erik Gilling Docs-Not-Needed: Jiacheng Lu Lint: Lint 🤖 --- pw_build/rust_bindgen_action.gni | 2 +- targets/host/target_toolchains.gni | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pw_build/rust_bindgen_action.gni b/pw_build/rust_bindgen_action.gni index 5352730560..a27264ef2c 100644 --- a/pw_build/rust_bindgen_action.gni +++ b/pw_build/rust_bindgen_action.gni @@ -39,7 +39,7 @@ template("rust_bindgen_action") { program = _bindgen_exe_path header = rebase_path(invoker.header, root_build_dir) - if (invoker.libclang_path) { + if (defined(invoker.libclang_path)) { # Note `-isysroot` may not work properly when `LIBCLANG_PATH` is set. env = [ "LIBCLANG_PATH=" + invoker.libclang_path ] } diff --git a/targets/host/target_toolchains.gni b/targets/host/target_toolchains.gni index 45d29534d4..7c44d0b39a 100644 --- a/targets/host/target_toolchains.gni +++ b/targets/host/target_toolchains.gni @@ -86,6 +86,7 @@ _linux_config = { pw_bloat_BLOATY_CONFIG = get_path_info("linux.bloaty", "abspath") pw_unit_test_AUTOMATIC_RUNNER = get_path_info("run_test", "abspath") pw_async2_DISPATCHER_BACKEND = "$dir_pw_async2_epoll:dispatcher_backend" + pw_rust_ENABLE_EXPERIMENTAL_BUILD = true } # macOS-specific target configuration.