From 1f5cba307066a47d83f14a71301dee6a5c0f5e0c Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Wed, 29 Jul 2026 09:01:41 +0900 Subject: [PATCH] fix(ulp): clarify buildv2 child marker Rename the internal ULP child-build marker to __ULP_BUILDV2 so component CMake files make the build-system scope explicit. Document that the marker is currently set only by the IDF_BUILD_V2 ULP child path. --- components/esp_adc/CMakeLists.txt | 4 ++-- components/esp_common/CMakeLists.txt | 6 +++--- components/esp_driver_i2s/CMakeLists.txt | 4 ++-- components/esp_driver_uart/CMakeLists.txt | 4 ++-- components/esp_hal_ana_conv/CMakeLists.txt | 4 ++-- components/esp_hal_clock/CMakeLists.txt | 4 ++-- components/esp_hal_dma/CMakeLists.txt | 4 ++-- components/esp_hal_gpio/CMakeLists.txt | 10 +++++----- components/esp_hal_gpspi/CMakeLists.txt | 4 ++-- components/esp_hal_i2c/CMakeLists.txt | 4 ++-- components/esp_hal_i2s/CMakeLists.txt | 4 ++-- components/esp_hal_pmu/CMakeLists.txt | 4 ++-- components/esp_hal_regi2c/CMakeLists.txt | 4 ++-- components/esp_hal_rtc_timer/CMakeLists.txt | 4 ++-- components/esp_hal_touch_sens/CMakeLists.txt | 4 ++-- components/esp_hal_uart/CMakeLists.txt | 4 ++-- components/esp_hw_support/CMakeLists.txt | 4 ++-- components/esp_rom/CMakeLists.txt | 4 ++-- components/hal/CMakeLists.txt | 4 ++-- components/log/CMakeLists.txt | 4 ++-- components/riscv/CMakeLists.txt | 8 ++++---- components/soc/CMakeLists.txt | 4 ++-- components/ulp/CMakeLists_v2.txt | 8 ++++---- components/ulp/cmake/ulp_project.cmake | 3 ++- components/ulp/project_include.cmake | 7 ++++--- tools/test_build_system/buildv2/test_ulp.py | 2 +- 26 files changed, 61 insertions(+), 59 deletions(-) diff --git a/components/esp_adc/CMakeLists.txt b/components/esp_adc/CMakeLists.txt index 6ef38b83bdf..352b5628547 100644 --- a/components/esp_adc/CMakeLists.txt +++ b/components/esp_adc/CMakeLists.txt @@ -6,8 +6,8 @@ endif() set(includes "include" "interface" "${target}/include") -# TODO(IDF-15983): potentially remove __ULP_BUILD handling from esp_adc -if(__ULP_BUILD) +# TODO(IDF-15983): potentially remove __ULP_BUILDV2 handling from esp_adc +if(__ULP_BUILDV2) # LP-core ADC shared code includes esp_adc/adc_oneshot.h from # ulp/lp_core/shared/include/ulp_lp_core_lp_adc_shared.h. idf_component_register(INCLUDE_DIRS ${includes} diff --git a/components/esp_common/CMakeLists.txt b/components/esp_common/CMakeLists.txt index 38d1af29178..f6289144428 100644 --- a/components/esp_common/CMakeLists.txt +++ b/components/esp_common/CMakeLists.txt @@ -1,7 +1,7 @@ idf_build_get_property(target IDF_TARGET) -# TODO(IDF-15945): potentially remove __ULP_BUILD handling from esp_common -if(${target} STREQUAL "linux" OR __ULP_BUILD) +# TODO(IDF-15945): potentially remove __ULP_BUILDV2 handling from esp_common +if(${target} STREQUAL "linux" OR __ULP_BUILDV2) # ULP sources include esp_err.h from components/ulp public and shared headers. set(ldfragments) else() @@ -10,7 +10,7 @@ endif() set(srcs) -if(NOT __ULP_BUILD) +if(NOT __ULP_BUILDV2) set(srcs "src/esp_err_to_name.c") endif() diff --git a/components/esp_driver_i2s/CMakeLists.txt b/components/esp_driver_i2s/CMakeLists.txt index 3cb4e904fda..6c1cabc023b 100644 --- a/components/esp_driver_i2s/CMakeLists.txt +++ b/components/esp_driver_i2s/CMakeLists.txt @@ -8,8 +8,8 @@ set(srcs) set(include "include") set(priv_requires esp_driver_gpio esp_driver_dma esp_pm esp_mm esp_hal_clock) -# TODO(IDF-15984): potentially remove __ULP_BUILD handling from esp_driver_i2s -if(__ULP_BUILD) +# TODO(IDF-15984): potentially remove __ULP_BUILDV2 handling from esp_driver_i2s +if(__ULP_BUILDV2) # LP-core VAD shared code includes driver/lp_i2s_vad.h from # ulp/lp_core/shared/include/ulp_lp_core_lp_vad_shared.h. idf_component_register(INCLUDE_DIRS ${include} diff --git a/components/esp_driver_uart/CMakeLists.txt b/components/esp_driver_uart/CMakeLists.txt index 971e0dc42ec..dea801491c9 100644 --- a/components/esp_driver_uart/CMakeLists.txt +++ b/components/esp_driver_uart/CMakeLists.txt @@ -3,8 +3,8 @@ idf_build_get_property(target IDF_TARGET) set(srcs) set(public_include "include") -# TODO(IDF-15946): potentially remove __ULP_BUILD handling from esp_driver_uart -if(__ULP_BUILD) +# TODO(IDF-15946): potentially remove __ULP_BUILDV2 handling from esp_driver_uart +if(__ULP_BUILDV2) # LP-core UART wakeup shared code includes driver/uart_wakeup.h from # ulp/lp_core/shared/include/ulp_lp_core_lp_uart_shared.h. set(ulp_srcs) diff --git a/components/esp_hal_ana_conv/CMakeLists.txt b/components/esp_hal_ana_conv/CMakeLists.txt index 89d06ddafff..7bd22f3f81f 100644 --- a/components/esp_hal_ana_conv/CMakeLists.txt +++ b/components/esp_hal_ana_conv/CMakeLists.txt @@ -17,8 +17,8 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") list(APPEND includes "${target}/include") endif() -# TODO(IDF-15985): potentially remove __ULP_BUILD handling from esp_hal_ana_conv -if(__ULP_BUILD) +# TODO(IDF-15985): potentially remove __ULP_BUILDV2 handling from esp_hal_ana_conv +if(__ULP_BUILDV2) # ULP ADC code includes ADC HAL headers from # ulp/ulp_riscv/ulp_core/ulp_riscv_adc.c and # ulp/lp_core/shared/include/ulp_lp_core_lp_adc_shared.h. Some target diff --git a/components/esp_hal_clock/CMakeLists.txt b/components/esp_hal_clock/CMakeLists.txt index 54d8e166c18..f4d6b2cba60 100644 --- a/components/esp_hal_clock/CMakeLists.txt +++ b/components/esp_hal_clock/CMakeLists.txt @@ -14,8 +14,8 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") list(APPEND includes "${target}/include") endif() -# TODO(IDF-15947): potentially remove __ULP_BUILD handling from esp_hal_clock -if(__ULP_BUILD) +# TODO(IDF-15947): potentially remove __ULP_BUILDV2 handling from esp_hal_clock +if(__ULP_BUILDV2) # LP-core timer shared code includes hal/clk_tree_ll.h from # ulp/lp_core/shared/ulp_lp_core_lp_timer_shared.c. Some target # clk_tree_ll.h headers include hal/regi2c_ctrl.h. diff --git a/components/esp_hal_dma/CMakeLists.txt b/components/esp_hal_dma/CMakeLists.txt index ee49cc52e67..f905fad0b3d 100644 --- a/components/esp_hal_dma/CMakeLists.txt +++ b/components/esp_hal_dma/CMakeLists.txt @@ -10,8 +10,8 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") list(APPEND public_include "${target}/include") endif() -# TODO(IDF-15991): potentially remove __ULP_BUILD handling from esp_hal_dma -if(__ULP_BUILD) +# TODO(IDF-15991): potentially remove __ULP_BUILDV2 handling from esp_hal_dma +if(__ULP_BUILDV2) # LP-core SPI uses components/esp_hal_gpspi/include/hal/spi_slave_hd_hal.h, # whose public headers include DMA HAL descriptor types. idf_component_register(INCLUDE_DIRS ${public_include} diff --git a/components/esp_hal_gpio/CMakeLists.txt b/components/esp_hal_gpio/CMakeLists.txt index 66d9a3df4b5..48712c06f67 100644 --- a/components/esp_hal_gpio/CMakeLists.txt +++ b/components/esp_hal_gpio/CMakeLists.txt @@ -10,20 +10,20 @@ endif() # ULP GPIO helpers include GPIO/RTC IO HAL headers from # ulp/ulp_riscv/ulp_core/include/ulp_riscv_gpio.h and # ulp/lp_core/lp_core/include/ulp_lp_core_gpio.h. -# TODO(IDF-15948): potentially remove __ULP_BUILD source exclusions from esp_hal_gpio -if(CONFIG_SOC_GPIO_PORT GREATER 0 AND NOT __ULP_BUILD) +# TODO(IDF-15948): potentially remove __ULP_BUILDV2 source exclusions from esp_hal_gpio +if(CONFIG_SOC_GPIO_PORT GREATER 0 AND NOT __ULP_BUILDV2) list(APPEND srcs "gpio_hal.c") endif() -if(CONFIG_SOC_RTCIO_PIN_COUNT GREATER 0 AND NOT __ULP_BUILD) +if(CONFIG_SOC_RTCIO_PIN_COUNT GREATER 0 AND NOT __ULP_BUILDV2) list(APPEND srcs "rtc_io_hal.c" "${target}/rtc_io_periph.c") endif() -if(CONFIG_SOC_DEDICATED_GPIO_SUPPORTED AND NOT __ULP_BUILD) +if(CONFIG_SOC_DEDICATED_GPIO_SUPPORTED AND NOT __ULP_BUILDV2) list(APPEND srcs "${target}/dedic_gpio_periph.c") endif() -if(CONFIG_SOC_SDM_SUPPORTED AND NOT __ULP_BUILD) +if(CONFIG_SOC_SDM_SUPPORTED AND NOT __ULP_BUILDV2) list(APPEND srcs "sdm_hal.c" "${target}/sdm_periph.c") endif() diff --git a/components/esp_hal_gpspi/CMakeLists.txt b/components/esp_hal_gpspi/CMakeLists.txt index d7d7a9c3a19..d29703f635d 100644 --- a/components/esp_hal_gpspi/CMakeLists.txt +++ b/components/esp_hal_gpspi/CMakeLists.txt @@ -7,8 +7,8 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") list(APPEND includes "${target}/include") endif() -# TODO(IDF-15986): potentially remove __ULP_BUILD handling from esp_hal_gpspi -if(__ULP_BUILD) +# TODO(IDF-15986): potentially remove __ULP_BUILDV2 handling from esp_hal_gpspi +if(__ULP_BUILDV2) # LP-core SPI code includes SPI HAL headers from # ulp/lp_core/lp_core/lp_core_spi.c. idf_component_register(INCLUDE_DIRS ${includes} diff --git a/components/esp_hal_i2c/CMakeLists.txt b/components/esp_hal_i2c/CMakeLists.txt index 7beb884e605..111612708ca 100644 --- a/components/esp_hal_i2c/CMakeLists.txt +++ b/components/esp_hal_i2c/CMakeLists.txt @@ -8,8 +8,8 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") endif() list(APPEND includes "include") -# TODO(IDF-15987): potentially remove __ULP_BUILD handling from esp_hal_i2c -if(__ULP_BUILD) +# TODO(IDF-15987): potentially remove __ULP_BUILDV2 handling from esp_hal_i2c +if(__ULP_BUILDV2) # ULP I2C code includes hal/i2c_ll.h and hal/i2c_types.h from # ulp/ulp_riscv/ulp_core/ulp_riscv_i2c.c and # ulp/lp_core/lp_core/lp_core_i2c.c. diff --git a/components/esp_hal_i2s/CMakeLists.txt b/components/esp_hal_i2s/CMakeLists.txt index ff61f48e1a0..a3e5700bfa7 100644 --- a/components/esp_hal_i2s/CMakeLists.txt +++ b/components/esp_hal_i2s/CMakeLists.txt @@ -11,8 +11,8 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") list(APPEND includes "${target}/include") endif() -# TODO(IDF-15988): potentially remove __ULP_BUILD handling from esp_hal_i2s -if(__ULP_BUILD) +# TODO(IDF-15988): potentially remove __ULP_BUILDV2 handling from esp_hal_i2s +if(__ULP_BUILDV2) # LP-core VAD shared code includes LP I2S HAL headers from # ulp/lp_core/shared/ulp_lp_core_lp_vad_shared.c. idf_component_register(INCLUDE_DIRS ${includes} diff --git a/components/esp_hal_pmu/CMakeLists.txt b/components/esp_hal_pmu/CMakeLists.txt index 5dfee33c531..4c361cd479b 100644 --- a/components/esp_hal_pmu/CMakeLists.txt +++ b/components/esp_hal_pmu/CMakeLists.txt @@ -9,8 +9,8 @@ set(public_include "include" "${target}/include") # targets, so CMake v2 builds need esp_hal_regi2c explicitly. set(requires soc hal esp_rom esp_hal_regi2c) -# TODO(IDF-15949): potentially remove __ULP_BUILD handling from esp_hal_pmu -if(__ULP_BUILD) +# TODO(IDF-15949): potentially remove __ULP_BUILDV2 handling from esp_hal_pmu +if(__ULP_BUILDV2) # LP-core runtime code includes hal/pmu_ll.h from # ulp/lp_core/lp_core/lp_core_utils.c. Some target brownout/VBAT headers # include hal/regi2c_ctrl.h. diff --git a/components/esp_hal_regi2c/CMakeLists.txt b/components/esp_hal_regi2c/CMakeLists.txt index 777dc4c7d2b..e346c38a15d 100644 --- a/components/esp_hal_regi2c/CMakeLists.txt +++ b/components/esp_hal_regi2c/CMakeLists.txt @@ -11,8 +11,8 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") list(APPEND includes "${target}/include") endif() -# TODO(IDF-15950): potentially remove __ULP_BUILD handling from esp_hal_regi2c -if(__ULP_BUILD) +# TODO(IDF-15950): potentially remove __ULP_BUILDV2 handling from esp_hal_regi2c +if(__ULP_BUILDV2) # ULP ADC support reaches REGI2C headers through ADC HAL includes used by # ulp/ulp_riscv/ulp_core/ulp_riscv_adc.c. idf_component_register(INCLUDE_DIRS ${includes} diff --git a/components/esp_hal_rtc_timer/CMakeLists.txt b/components/esp_hal_rtc_timer/CMakeLists.txt index aac57179c06..16a26d220be 100644 --- a/components/esp_hal_rtc_timer/CMakeLists.txt +++ b/components/esp_hal_rtc_timer/CMakeLists.txt @@ -6,8 +6,8 @@ endif() set(srcs) set(public_include "include" "${target}/include") -# TODO(IDF-15992): potentially remove __ULP_BUILD handling from esp_hal_rtc_timer -if(__ULP_BUILD) +# TODO(IDF-15992): potentially remove __ULP_BUILDV2 handling from esp_hal_rtc_timer +if(__ULP_BUILDV2) # LP-core timer shared code includes hal/rtc_timer_ll.h from # ulp/lp_core/shared/ulp_lp_core_lp_timer_shared.c. idf_component_register(INCLUDE_DIRS ${public_include} diff --git a/components/esp_hal_touch_sens/CMakeLists.txt b/components/esp_hal_touch_sens/CMakeLists.txt index 185d5763779..f05a181c7ed 100644 --- a/components/esp_hal_touch_sens/CMakeLists.txt +++ b/components/esp_hal_touch_sens/CMakeLists.txt @@ -12,8 +12,8 @@ endif() # "include" should be behind "${target}/include", because `include_next` has sequence requirement list(APPEND includes "include") -# TODO(IDF-15989): potentially remove __ULP_BUILD handling from esp_hal_touch_sens -if(__ULP_BUILD) +# TODO(IDF-15989): potentially remove __ULP_BUILDV2 handling from esp_hal_touch_sens +if(__ULP_BUILDV2) # ULP touch support includes touch sensor HAL headers from # ulp/ulp_riscv/ulp_core/ulp_riscv_touch.c and # ulp/lp_core/lp_core/lp_core_touch.c. diff --git a/components/esp_hal_uart/CMakeLists.txt b/components/esp_hal_uart/CMakeLists.txt index 35c0508abd0..9f7f7000c57 100644 --- a/components/esp_hal_uart/CMakeLists.txt +++ b/components/esp_hal_uart/CMakeLists.txt @@ -8,8 +8,8 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") list(APPEND includes "${target}/include") endif() -# TODO(IDF-15990): potentially remove __ULP_BUILD handling from esp_hal_uart -if(__ULP_BUILD) +# TODO(IDF-15990): potentially remove __ULP_BUILDV2 handling from esp_hal_uart +if(__ULP_BUILDV2) # LP-core UART and print code includes UART HAL headers from # ulp/lp_core/lp_core/lp_core_uart.c and # ulp/lp_core/lp_core/lp_core_print.c. diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index a83f9c705eb..8f31692ba13 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -30,8 +30,8 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/port/${target}/include") ) endif() -# TODO(IDF-15951): potentially remove __ULP_BUILD handling from esp_hw_support -if(__ULP_BUILD) +# TODO(IDF-15951): potentially remove __ULP_BUILDV2 handling from esp_hw_support +if(__ULP_BUILDV2) # ULP headers and LP-core runtime include esp_intr_alloc.h and esp_cpu.h from # ulp/ulp_riscv/include/ulp_riscv.h and # ulp/lp_core/lp_core/lp_core_ubsan.c. diff --git a/components/esp_rom/CMakeLists.txt b/components/esp_rom/CMakeLists.txt index 33f372fab66..878c4c0fa30 100644 --- a/components/esp_rom/CMakeLists.txt +++ b/components/esp_rom/CMakeLists.txt @@ -7,8 +7,8 @@ set(include_dirs "include" "${target_folder}/include/${target_folder}" "${target_folder}") -# TODO(IDF-15952): potentially remove __ULP_BUILD handling from esp_rom -if(__ULP_BUILD) +# TODO(IDF-15952): potentially remove __ULP_BUILDV2 handling from esp_rom +if(__ULP_BUILDV2) # LP-core runtime and print code include ROM headers from # ulp/lp_core/lp_core/lp_core_startup.c and # ulp/lp_core/lp_core/lp_core_print.c. diff --git a/components/hal/CMakeLists.txt b/components/hal/CMakeLists.txt index b7bd8ad5871..35021204d28 100644 --- a/components/hal/CMakeLists.txt +++ b/components/hal/CMakeLists.txt @@ -14,8 +14,8 @@ list(APPEND includes "include") # ULP runtime code includes generic HAL headers, for example hal/lp_core_ll.h # from ulp/lp_core/lp_core/lp_core_interrupt.c. -# TODO(IDF-15953): potentially remove __ULP_BUILD handling from hal -if(__ULP_BUILD) +# TODO(IDF-15953): potentially remove __ULP_BUILDV2 handling from hal +if(__ULP_BUILDV2) idf_component_register(INCLUDE_DIRS ${includes} PRIV_INCLUDE_DIRS ${priv_include} REQUIRES esp_common ${requires}) diff --git a/components/log/CMakeLists.txt b/components/log/CMakeLists.txt index ae7eb5258bd..8ac4311ac2f 100644 --- a/components/log/CMakeLists.txt +++ b/components/log/CMakeLists.txt @@ -1,8 +1,8 @@ idf_build_get_property(target IDF_TARGET) idf_build_get_property(non_os_build NON_OS_BUILD) -# TODO(IDF-15954): potentially remove __ULP_BUILD handling from log -if(__ULP_BUILD) +# TODO(IDF-15954): potentially remove __ULP_BUILDV2 handling from log +if(__ULP_BUILDV2) # LP-core UART wakeup support builds components/esp_driver_uart/src/uart_wakeup.c, # which includes ESP log headers. idf_component_register(INCLUDE_DIRS "include" diff --git a/components/riscv/CMakeLists.txt b/components/riscv/CMakeLists.txt index 6be7fe3eed0..e3def9e5b34 100644 --- a/components/riscv/CMakeLists.txt +++ b/components/riscv/CMakeLists.txt @@ -2,19 +2,19 @@ idf_build_get_property(target IDF_TARGET) idf_build_get_property(arch IDF_TARGET_ARCH) idf_build_get_property(esp_tee_build ESP_TEE_BUILD) -# TODO(IDF-15955): potentially remove __ULP_BUILD handling from riscv -if(NOT "${arch}" STREQUAL "riscv" AND NOT (__ULP_BUILD AND "${ULP_TYPE}" STREQUAL "riscv")) +# TODO(IDF-15955): potentially remove __ULP_BUILDV2 handling from riscv +if(NOT "${arch}" STREQUAL "riscv" AND NOT (__ULP_BUILDV2 AND "${ULP_TYPE}" STREQUAL "riscv")) return() endif() -if(__ULP_BUILD AND "${ULP_TYPE}" STREQUAL "riscv") +if(__ULP_BUILDV2 AND "${ULP_TYPE}" STREQUAL "riscv") # RISC-V ULP interrupt support includes riscv/interrupt.h from # ulp/ulp_riscv/ulp_core/include/ulp_riscv_interrupt.h. idf_component_register(INCLUDE_DIRS "include") return() endif() -# When __ULP_BUILD and ULP_TYPE is lp_core, keep the normal RISC-V helper sources for headers +# When __ULP_BUILDV2 and ULP_TYPE is lp_core, keep the normal RISC-V helper sources for headers # used by ulp/lp_core/lp_core/lp_core_pmp.c and vector.S. if(BOOTLOADER_BUILD) diff --git a/components/soc/CMakeLists.txt b/components/soc/CMakeLists.txt index a1e36e530a0..d3bc737c720 100644 --- a/components/soc/CMakeLists.txt +++ b/components/soc/CMakeLists.txt @@ -31,8 +31,8 @@ else() endif() endif() -# TODO(IDF-15956): potentially remove __ULP_BUILD handling from soc -if(__ULP_BUILD) +# TODO(IDF-15956): potentially remove __ULP_BUILDV2 handling from soc +if(__ULP_BUILDV2) idf_component_register(INCLUDE_DIRS ${includes} REQUIRES esp_common) diff --git a/components/ulp/CMakeLists_v2.txt b/components/ulp/CMakeLists_v2.txt index 3c005698a9b..e17023fc259 100644 --- a/components/ulp/CMakeLists_v2.txt +++ b/components/ulp/CMakeLists_v2.txt @@ -3,7 +3,7 @@ set(includes "") set(requires "") set(priv_requires "") -if(__ULP_BUILD) +if(__ULP_BUILDV2) if(ULP_TYPE STREQUAL "riscv") list(APPEND includes ulp_common/include @@ -117,7 +117,7 @@ if(__ULP_BUILD) ulp_fsm/include/${target}) list(APPEND requires soc) else() - message(FATAL_ERROR "__ULP_BUILD requires ULP_TYPE to be one of: riscv, lp_core, fsm.") + message(FATAL_ERROR "__ULP_BUILDV2 requires ULP_TYPE to be one of: riscv, lp_core, fsm.") endif() else() # TODO(IDF-15993): Keep esp_driver_gpio and esp_adc public for compatibility @@ -267,7 +267,7 @@ if(priv_requires) endif() set(whole_archive) -if(__ULP_BUILD) +if(__ULP_BUILDV2) # Legacy ULP child builds added the LP-core runtime sources directly to the # executable. Preserve that behavior so strong handlers such as # ulp_lp_core_panic_handler are not dropped in favor of weak defaults from @@ -283,7 +283,7 @@ idf_component_register(SRCS ${srcs} # In the parent app build, the ulp component only provides the host-side API. # The executable/linker setup below is for native ULP child projects. -if(NOT __ULP_BUILD) +if(NOT __ULP_BUILDV2) idf_define_esp_err_codes(HEADERS ulp_fsm/include/ulp_fsm_common.h) return() endif() diff --git a/components/ulp/cmake/ulp_project.cmake b/components/ulp/cmake/ulp_project.cmake index 5c23d940a04..96dfe0129ec 100644 --- a/components/ulp/cmake/ulp_project.cmake +++ b/components/ulp/cmake/ulp_project.cmake @@ -9,7 +9,8 @@ include(${IDF_PATH}/tools/cmakev2/idf.cmake) include(${CMAKE_CURRENT_LIST_DIR}/IDFULPProjectCommon.cmake) -if(__ULP_BUILD) +# __ULP_BUILDV2 is only set by the IDF_BUILD_V2 ULP child path for now. +if(__ULP_BUILDV2) set(NON_OS_BUILD 1) # Clearing common components below only prevents automatic app-component closure. # Explicitly included ULP dependencies still read NON_OS_BUILD to select their no-OS shape. diff --git a/components/ulp/project_include.cmake b/components/ulp/project_include.cmake index 4a0b02a0566..20f184aeecf 100644 --- a/components/ulp/project_include.cmake +++ b/components/ulp/project_include.cmake @@ -1,4 +1,4 @@ -if(IDF_BUILD_V2 AND __ULP_BUILD) +if(IDF_BUILD_V2 AND __ULP_BUILDV2) return() endif() @@ -134,8 +134,9 @@ function(__setup_ulp_project app_name project_path prefix prefix_append_bin_name -DULP_APP_NAME=${app_name} -DIDF_BUILD_V2=y -DCMAKE_MODULE_PATH=${ulp_cmake_dir} - # Internal marker for the ULP child project component graph. - -D__ULP_BUILD=1 + # Internal marker for ULP child component graphs. Only the + # IDF_BUILD_V2 path sets it for now. + -D__ULP_BUILDV2=1 -DIDF_PARENT_BUILD_DIR=${build_dir} -DULP_PREFIX_APPEND_BIN_NAME=${prefix_append_bin_name} -DULP_PARENT_SDKCONFIG_HEADER=${SDKCONFIG_HEADER} diff --git a/tools/test_build_system/buildv2/test_ulp.py b/tools/test_build_system/buildv2/test_ulp.py index d63e44047b9..77750628a34 100644 --- a/tools/test_build_system/buildv2/test_ulp.py +++ b/tools/test_build_system/buildv2/test_ulp.py @@ -132,7 +132,7 @@ def test_ulp_cmake_api_availability( '-DIDF_TARGET=esp32c6', f'-DSDKCONFIG_CMAKE={_cmake_path(project_dir / "sdkconfig.cmake")}', f'-DSDKCONFIG_HEADER={_cmake_path(project_dir / "sdkconfig.h")}', - '-D__ULP_BUILD=1', + '-D__ULP_BUILDV2=1', '-DULP_APP_NAME=ulp_api_probe', '-DULP_TYPE=lp_core', '-DIDF_BUILD_V2=y',