kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/build_fails_when_editor_assoc_with_py_scripts' into 'master'
Fix issues with CMake builds when python scripts are associated with an editor See merge request idf/esp-idf!4459pull/3175/head
commit
76fd26c9fb
|
@ -5,9 +5,9 @@ endif()
|
||||||
# Set some global esptool.py variables
|
# Set some global esptool.py variables
|
||||||
#
|
#
|
||||||
# Many of these are read when generating flash_app_args & flash_project_args
|
# Many of these are read when generating flash_app_args & flash_project_args
|
||||||
set(ESPTOOLPY "${CMAKE_CURRENT_LIST_DIR}/esptool/esptool.py" --chip esp32)
|
set(ESPTOOLPY ${PYTHON} "${CMAKE_CURRENT_LIST_DIR}/esptool/esptool.py" --chip esp32)
|
||||||
set(ESPSECUREPY "${CMAKE_CURRENT_LIST_DIR}/esptool/espsecure.py")
|
set(ESPSECUREPY ${PYTHON} "${CMAKE_CURRENT_LIST_DIR}/esptool/espsecure.py")
|
||||||
set(ESPEFUSEPY "${CMAKE_CURRENT_LIST_DIR}/esptool/espefuse.py")
|
set(ESPEFUSEPY ${PYTHON} "${CMAKE_CURRENT_LIST_DIR}/esptool/espefuse.py")
|
||||||
|
|
||||||
set(ESPFLASHMODE ${CONFIG_ESPTOOLPY_FLASHMODE})
|
set(ESPFLASHMODE ${CONFIG_ESPTOOLPY_FLASHMODE})
|
||||||
set(ESPFLASHFREQ ${CONFIG_ESPTOOLPY_FLASHFREQ})
|
set(ESPFLASHFREQ ${CONFIG_ESPTOOLPY_FLASHFREQ})
|
||||||
|
|
|
@ -28,7 +28,7 @@ if(NOT as_version STREQUAL as_supported_version)
|
||||||
the toolchain, or proceed at your own risk.")
|
the toolchain, or proceed at your own risk.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(ULP_MAP_GEN ${IDF_PATH}/components/ulp/esp32ulp_mapgen.py)
|
set(ULP_MAP_GEN ${PYTHON} ${IDF_PATH}/components/ulp/esp32ulp_mapgen.py)
|
||||||
set(ULP_LD_TEMPLATE ${IDF_PATH}/components/ulp/ld/esp32.ulp.ld)
|
set(ULP_LD_TEMPLATE ${IDF_PATH}/components/ulp/ld/esp32.ulp.ld)
|
||||||
|
|
||||||
get_filename_component(sdkconfig_dir ${SDKCONFIG} DIRECTORY)
|
get_filename_component(sdkconfig_dir ${SDKCONFIG} DIRECTORY)
|
||||||
|
|
|
@ -335,17 +335,33 @@ function run_tests()
|
||||||
idf.py reconfigure > /dev/null;
|
idf.py reconfigure > /dev/null;
|
||||||
grep "CONFIG_PARTITION_TABLE_OFFSET=0x10000" sdkconfig || failure "The define from sdkconfig.defaults should be into sdkconfig"
|
grep "CONFIG_PARTITION_TABLE_OFFSET=0x10000" sdkconfig || failure "The define from sdkconfig.defaults should be into sdkconfig"
|
||||||
grep "CONFIG_PARTITION_TABLE_TWO_OTA=y" sdkconfig || failure "The define from sdkconfig should be into sdkconfig"
|
grep "CONFIG_PARTITION_TABLE_TWO_OTA=y" sdkconfig || failure "The define from sdkconfig should be into sdkconfig"
|
||||||
|
rm sdkconfig;
|
||||||
|
rm sdkconfig.defaults;
|
||||||
|
|
||||||
print_status "Building a project with CMake library imported and PSRAM workaround, all files compile with workaround"
|
print_status "Building a project with CMake library imported and PSRAM workaround, all files compile with workaround"
|
||||||
cp sdkconfig sdkconfig.psram
|
|
||||||
rm -rf build
|
rm -rf build
|
||||||
echo "CONFIG_SPIRAM_SUPPORT=y" >> sdkconfig.psram
|
echo "CONFIG_SPIRAM_SUPPORT=y" >> sdkconfig.defaults
|
||||||
echo "CONFIG_SPIRAM_CACHE_WORKAROUND=y" >> sdkconfig.psram
|
echo "CONFIG_SPIRAM_CACHE_WORKAROUND=y" >> sdkconfig.defaults
|
||||||
# note: we do 'reconfigure' here, as we just need to run cmake
|
# note: we do 'reconfigure' here, as we just need to run cmake
|
||||||
idf.py -C $IDF_PATH/examples/build_system/cmake/import_lib -B `pwd`/build reconfigure -D SDKCONFIG="`pwd`/sdkconfig.psram"
|
idf.py -C $IDF_PATH/examples/build_system/cmake/import_lib -B `pwd`/build reconfigure -D SDKCONFIG_DEFAULTS="`pwd`/sdkconfig.defaults"
|
||||||
grep -q '"command"' build/compile_commands.json || failure "compile_commands.json missing or has no no 'commands' in it"
|
grep -q '"command"' build/compile_commands.json || failure "compile_commands.json missing or has no no 'commands' in it"
|
||||||
(grep '"command"' build/compile_commands.json | grep -v mfix-esp32-psram-cache-issue) && failure "All commands in compile_commands.json should use PSRAM cache workaround"
|
(grep '"command"' build/compile_commands.json | grep -v mfix-esp32-psram-cache-issue) && failure "All commands in compile_commands.json should use PSRAM cache workaround"
|
||||||
rm sdkconfig.psram
|
rm sdkconfig.defaults
|
||||||
|
|
||||||
|
print_status "Make sure a full build never runs '/usr/bin/env python' or similar"
|
||||||
|
OLDPATH="$PATH"
|
||||||
|
PYTHON="$(which python)"
|
||||||
|
rm -rf build
|
||||||
|
cat > ./python << EOF
|
||||||
|
#!/bin/sh
|
||||||
|
echo "The build system has executed '/usr/bin/env python' or similar"
|
||||||
|
exit 1
|
||||||
|
EOF
|
||||||
|
chmod +x ./python
|
||||||
|
export PATH="$(pwd):$PATH"
|
||||||
|
${PYTHON} $IDF_PATH/tools/idf.py build || failure "build failed"
|
||||||
|
export PATH="$OLDPATH"
|
||||||
|
rm ./python
|
||||||
|
|
||||||
print_status "All tests completed"
|
print_status "All tests completed"
|
||||||
if [ -n "${FAILURES}" ]; then
|
if [ -n "${FAILURES}" ]; then
|
||||||
|
|
|
@ -53,7 +53,7 @@ function(ldgen_process_template template output)
|
||||||
# Create command to invoke the linker script generator tool.
|
# Create command to invoke the linker script generator tool.
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${output}
|
OUTPUT ${output}
|
||||||
COMMAND ${IDF_PATH}/tools/ldgen/ldgen.py
|
COMMAND ${PYTHON} ${IDF_PATH}/tools/ldgen/ldgen.py
|
||||||
--config ${SDKCONFIG}
|
--config ${SDKCONFIG}
|
||||||
--fragments "$<JOIN:$<TARGET_PROPERTY:ldgen,FRAGMENT_FILES>,\t>"
|
--fragments "$<JOIN:$<TARGET_PROPERTY:ldgen,FRAGMENT_FILES>,\t>"
|
||||||
--input ${template}
|
--input ${template}
|
||||||
|
|
Ładowanie…
Reference in New Issue