Skip to content

Commit d52b710

Browse files
committed
cmake: Add ZEPHYR_BASE to environment in template
Export the ZEPHYR_BASE environment variable to the generated `.cargo/config.toml` file. The regular zephyr build system will set this if it is not set, but then trying to run a standalone build will cause the bindgen build to fail, as it needs this value. Explicitly place it into the environment to allow this to work. Signed-off-by: David Brown <[email protected]>
1 parent a5e05cc commit d52b710

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ ${module}.path = \"$CACHE{RUST_MODULE_DIR}/${module}\"
122122
# symlink) in the source directory to allow various IDE tools and such to work. The build we
123123
# invoke will override these settings, in case they are out of date. Everything set here
124124
# should match the arguments given to the cargo build command below.
125+
# To allow this to be run outside of the tree, this also includes some things set in the
126+
# environment by the normal build process.
125127
file(WRITE ${SAMPLE_CARGO_CONFIG} "
126128
# This is a generated sample .cargo/config.toml file from the Zephyr build.
127129
# At the time of generation, this represented the settings needed to allow
@@ -138,6 +140,7 @@ ZEPHYR_DTS = \"${ZEPHYR_DTS}\"
138140
INCLUDE_DIRS = \"${include_dirs}\"
139141
INCLUDE_DEFINES = \"${include_defines}\"
140142
WRAPPER_FILE = \"${WRAPPER_FILE}\"
143+
ZEPHYR_BASE = \"${ZEPHYR_BASE}\"
141144
142145
[patch.crates-io]
143146
${config_paths}

0 commit comments

Comments
 (0)