CMakeLists.txt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. idf_build_get_property(idf_target IDF_TARGET)
  2. if(${idf_target} STREQUAL "linux")
  3. return() # This component is not supported by the POSIX/Linux simulator
  4. endif()
  5. if(CONFIG_ESP_COEX_SW_COEXIST_ENABLE OR CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE)
  6. if(CONFIG_APP_NO_BLOBS)
  7. set(link_binary_libs 0)
  8. set(ldfragments)
  9. else()
  10. set(link_binary_libs 1)
  11. set(ldfragments "linker.lf")
  12. endif()
  13. set(srcs "src/coexist.c"
  14. "${idf_target}/esp_coex_adapter.c")
  15. endif()
  16. if(CONFIG_ESP_WIFI_ENABLED)
  17. list(APPEND srcs "${idf_target}/esp_coex_adapter.c")
  18. endif()
  19. idf_component_register(SRCS "${srcs}"
  20. INCLUDE_DIRS "include"
  21. PRIV_REQUIRES esp_timer driver esp_event
  22. LDFRAGMENTS "${ldfragments}")
  23. if(CONFIG_ESP_COEX_SW_COEXIST_ENABLE OR CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE)
  24. idf_build_get_property(build_dir BUILD_DIR)
  25. set(target_name "${idf_target}")
  26. target_link_directories(${COMPONENT_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/lib/${target_name}")
  27. if(link_binary_libs)
  28. set(blob coexist)
  29. add_prebuilt_library(${blob} "${CMAKE_CURRENT_SOURCE_DIR}/lib/${target_name}/lib${blob}.a"
  30. REQUIRES ${COMPONENT_NAME})
  31. target_link_libraries(${COMPONENT_LIB} PUBLIC ${blob})
  32. endif()
  33. target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
  34. endif()