CMakeLists.txt 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. if(BOOTLOADER_BUILD)
  2. # Bootloader relies on some Kconfig options defined in esp_system.
  3. idf_component_register()
  4. return()
  5. endif()
  6. idf_component_register(SRCS "intr_alloc.c"
  7. "esp_async_memcpy.c"
  8. "panic.c"
  9. "system_api.c"
  10. "startup.c"
  11. "system_time.c"
  12. "sleep_modes.c"
  13. INCLUDE_DIRS include
  14. PRIV_REQUIRES spi_flash
  15. # [refactor-todo] requirements due to init code,
  16. # should be removable once using component init functions
  17. # link-time registration is used.
  18. esp_pm app_update nvs_flash pthread app_trace esp_gdbstub
  19. LDFRAGMENTS "linker.lf")
  20. add_subdirectory(port)
  21. # After system initialization, `start_app` (and its other cores variant) is called.
  22. # This is provided by the user or from another component. Since we can't establish
  23. # dependency on what we don't know, force linker to not drop the symbol regardless
  24. # of link line order.
  25. target_link_libraries(${COMPONENT_LIB} INTERFACE "-u start_app")
  26. if(NOT CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE)
  27. target_link_libraries(${COMPONENT_LIB} INTERFACE "-u start_app_other_cores")
  28. endif()
  29. # Disable stack protection in files which are involved in initialization of that feature
  30. set_source_files_properties(
  31. startup.c
  32. PROPERTIES COMPILE_FLAGS
  33. -fno-stack-protector)
  34. if(NOT CMAKE_BUILD_EARLY_EXPANSION)
  35. set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/sleep_modes.c" PROPERTIES
  36. COMPILE_FLAGS "-fno-jump-tables -fno-tree-switch-conversion")
  37. endif()