mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-31 22:24:28 +00:00
CMake: Make IDF_PATH available to Kconfiglib when not explicitly set.
When IDF_PATH is not set by the user, cmake infers the same through other means and sets it as an environment variable. However, some sub-invocation of cmake may not see this variable as it is not set in the parent. This change adds a custom command for exporting IDF_PATH just before invoking ldgen so that IDF_PATH can be used in Kconfig without any errors.
This commit is contained in:
@@ -236,6 +236,21 @@ function run_tests()
|
||||
mv CMakeLists.txt.bak CMakeLists.txt
|
||||
assert_built ${APP_BINS} ${BOOTLOADER_BINS} ${PARTITION_BIN}
|
||||
|
||||
print_status "Can build with IDF_PATH unset and inferred by cmake when Kconfig needs it to be set"
|
||||
clean_build_dir
|
||||
sed -i.bak 's/ENV{IDF_PATH}/{IDF_PATH}/' CMakeLists.txt
|
||||
export IDF_PATH_BACKUP="$IDF_PATH"
|
||||
mv main/Kconfig.projbuild main/Kconfig.projbuild_bak
|
||||
echo "source \"\$IDF_PATH/examples/wifi/getting_started/station/main/Kconfig.projbuild\"" > main/Kconfig.projbuild
|
||||
(unset IDF_PATH &&
|
||||
cd build &&
|
||||
cmake -G Ninja .. -DIDF_PATH=${IDF_PATH_BACKUP} &&
|
||||
ninja) || failure "Ninja build failed"
|
||||
mv CMakeLists.txt.bak CMakeLists.txt
|
||||
mv main/Kconfig.projbuild_bak main/Kconfig.projbuild
|
||||
assert_built ${APP_BINS} ${BOOTLOADER_BINS} ${PARTITION_BIN}
|
||||
|
||||
|
||||
# Next two tests will use this fake 'esp31b' target
|
||||
export fake_target=esp31b
|
||||
mkdir -p components/$fake_target
|
||||
|
Reference in New Issue
Block a user