mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 21:54:33 +02:00
esp_hw_support: Clean up CMakeLists file
This commit is contained in:
committed by
Michael (XIAO Xufeng)
parent
9d6366f290
commit
356d7b6da3
@@ -7,8 +7,6 @@ if(${target} STREQUAL "esp32")
|
|||||||
list(APPEND requires efuse)
|
list(APPEND requires efuse)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(priv_requires efuse bootloader_support spi_flash)
|
|
||||||
|
|
||||||
set(srcs "compare_set.c" "cpu_util.c")
|
set(srcs "compare_set.c" "cpu_util.c")
|
||||||
if(NOT BOOTLOADER_BUILD)
|
if(NOT BOOTLOADER_BUILD)
|
||||||
list(APPEND srcs "esp_async_memcpy.c"
|
list(APPEND srcs "esp_async_memcpy.c"
|
||||||
@@ -35,33 +33,26 @@ idf_component_register(SRCS ${srcs}
|
|||||||
idf_build_get_property(target IDF_TARGET)
|
idf_build_get_property(target IDF_TARGET)
|
||||||
add_subdirectory(port/${target})
|
add_subdirectory(port/${target})
|
||||||
|
|
||||||
if(NOT BOOTLOADER_BUILD)
|
if(CONFIG_IDF_TARGET_ESP32 AND CONFIG_SPIRAM_CACHE_WORKAROUND AND NOT BOOTLOADER_BUILD)
|
||||||
|
# Note: Adding as a PUBLIC compile option here causes this option to propagate to all
|
||||||
if(CONFIG_SPIRAM_CACHE_WORKAROUND)
|
# components that depend on esp32.
|
||||||
# Note: Adding as a PUBLIC compile option here causes this option to propagate to all
|
#
|
||||||
# components that depend on esp32.
|
# To handle some corner cases, the same flag is set in project_include.cmake
|
||||||
#
|
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-issue)
|
||||||
# To handle some corner cases, the same flag is set in project_include.cmake
|
# also, make sure we link with this option so correct toolchain libs are pulled in
|
||||||
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-issue)
|
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-issue)
|
||||||
# also, make sure we link with this option so correct toolchain libs are pulled in
|
# set strategy selected
|
||||||
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-issue)
|
# note that we don't need to set link options as the library linked is independent of this
|
||||||
# set strategy selected
|
if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST)
|
||||||
# note that we don't need to set link options as the library linked is independent of this
|
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=dupldst)
|
||||||
if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST)
|
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=dupldst)
|
||||||
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=dupldst)
|
endif()
|
||||||
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=dupldst)
|
if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW)
|
||||||
endif()
|
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=memw)
|
||||||
if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW)
|
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=memw)
|
||||||
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=memw)
|
endif()
|
||||||
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=memw)
|
if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS)
|
||||||
endif()
|
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=nops)
|
||||||
if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS)
|
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=nops)
|
||||||
target_compile_options(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=nops)
|
|
||||||
target_link_libraries(${COMPONENT_LIB} PUBLIC -mfix-esp32-psram-cache-strategy=nops)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/sleep_modes.c" PROPERTIES
|
|
||||||
COMPILE_FLAGS "-fno-jump-tables -fno-tree-switch-conversion")
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
if(CONFIG_SPIRAM_CACHE_WORKAROUND AND NOT BOOTLOADER_BUILD)
|
if(CONFIG_IDF_TARGET_ESP32 AND CONFIG_SPIRAM_CACHE_WORKAROUND AND NOT BOOTLOADER_BUILD)
|
||||||
# We do this here as well as in CMakeLists.txt, because targets that
|
# We do this here as well as in CMakeLists.txt, because targets that
|
||||||
# are not part of the ESP-IDF build system (for cases where a generic
|
# are not part of the ESP-IDF build system (for cases where a generic
|
||||||
# non-IDF CMakeLists.txt file is imported into a component) don't depend
|
# non-IDF CMakeLists.txt file is imported into a component) don't depend
|
||||||
|
Reference in New Issue
Block a user