esp-idf/components/esp_coex/CMakeLists.txt

54 lines
1.8 KiB
CMake
Raw Normal View History

idf_build_get_property(idf_target IDF_TARGET)
2023-02-14 08:20:55 -05:00
if(CONFIG_ESP_COEX_SW_COEXIST_ENABLE OR CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE)
if(CONFIG_APP_NO_BLOBS)
set(link_binary_libs 0)
set(ldfragments)
else()
set(link_binary_libs 1)
set(ldfragments "linker.lf")
endif()
2023-03-10 01:31:33 -05:00
# TODO: need to remove these logic when unsupport esp32h4.
if(IDF_TARGET STREQUAL "esp32h4")
set(srcs
"src/coexist.c"
2023-03-10 01:31:33 -05:00
"esp32h2/esp_coex_adapter.c")
else()
set(srcs
"src/coexist.c"
"${idf_target}/esp_coex_adapter.c")
endif()
endif()
2023-02-14 08:20:55 -05:00
if(CONFIG_ESP_WIFI_ENABLED)
list(APPEND srcs "${idf_target}/esp_coex_adapter.c")
endif()
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "include"
PRIV_REQUIRES esp_timer driver esp_event
LDFRAGMENTS "${ldfragments}")
2023-02-14 08:20:55 -05:00
if(CONFIG_ESP_COEX_SW_COEXIST_ENABLE OR CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE)
idf_build_get_property(build_dir BUILD_DIR)
set(target_name "${idf_target}")
target_link_directories(${COMPONENT_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/lib/${target_name}")
if(link_binary_libs)
2023-02-14 08:20:55 -05:00
set(blob coexist)
2023-03-10 01:31:33 -05:00
# TODO: need to remove these logic when unsupport esp32h4.
if(IDF_TARGET STREQUAL "esp32h4")
add_prebuilt_library(${blob} "${CMAKE_CURRENT_SOURCE_DIR}/lib/esp32h2/lib${blob}.a"
REQUIRES ${COMPONENT_NAME})
else()
add_prebuilt_library(${blob} "${CMAKE_CURRENT_SOURCE_DIR}/lib/${target_name}/lib${blob}.a"
REQUIRES ${COMPONENT_NAME})
endif()
2023-02-14 08:20:55 -05:00
target_link_libraries(${COMPONENT_LIB} PUBLIC ${blob})
endif()
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
endif()