Skip to content

Commit 4e9e582

Browse files
committed
Merge branch 'bugfix/check_missing_IDF_ENV_FPGA_environment' into 'master'
kconfig: fix IDF_ENV_FPGA not found See merge request espressif/esp-idf!9200
2 parents ca50718 + c963440 commit 4e9e582

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tools/cmake/kconfig.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,16 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
259259
set(TERM_CHECK_CMD ${python} ${idf_path}/tools/check_term.py)
260260
endif()
261261

262+
idf_build_get_property(idf_env_fpga __IDF_ENV_FPGA)
263+
262264
# Generate the menuconfig target
263265
add_custom_target(menuconfig
264266
${menuconfig_depends}
265267
# create any missing config file, with defaults if necessary
266268
COMMAND ${prepare_kconfig_files_command}
267269
COMMAND ${confgen_basecommand}
268270
--env "IDF_TARGET=${idf_target}"
271+
--env "IDF_ENV_FPGA=${idf_env_fpga}"
269272
--dont-write-deprecated
270273
--output config ${sdkconfig}
271274
COMMAND ${TERM_CHECK_CMD}
@@ -275,13 +278,17 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
275278
"IDF_CMAKE=y"
276279
"KCONFIG_CONFIG=${sdkconfig}"
277280
"IDF_TARGET=${idf_target}"
281+
"IDF_ENV_FPGA=${idf_env_fpga}"
278282
${MENUCONFIG_CMD} ${root_kconfig}
279283
# VERBATIM cannot be used here because it cannot handle ${mconf}="winpty mconf-idf" and the escaping must be
280284
# done manually
281285
USES_TERMINAL
282286
# additional run of confgen esures that the deprecated options will be inserted into sdkconfig (for backward
283287
# compatibility)
284-
COMMAND ${confgen_basecommand} --env "IDF_TARGET=${idf_target}" --output config ${sdkconfig}
288+
COMMAND ${confgen_basecommand}
289+
--env "IDF_TARGET=${idf_target}"
290+
--env "IDF_ENV_FPGA=${idf_env_fpga}"
291+
--output config ${sdkconfig}
285292
)
286293

287294
# Custom target to run confserver.py from the build tool

tools/cmake/targets.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ macro(__target_init)
2727

2828
# Finally, set IDF_TARGET in cache
2929
set(IDF_TARGET ${env_idf_target} CACHE STRING "IDF Build Target")
30+
31+
# Check if IDF_ENV_FPGA environment is set
32+
set(env_idf_env_fpga $ENV{IDF_ENV_FPGA})
33+
if(${env_idf_env_fpga})
34+
idf_build_set_property(__IDF_ENV_FPGA "y")
35+
message(STATUS "IDF_ENV_FPGA is set, building for FPGA environment")
36+
endif()
3037
endmacro()
3138

3239
#

0 commit comments

Comments
 (0)