endforeach()
if(libraries)
+ # gc-sections is necessary for linking some IDF binary libraries
+ # (and without it, IDF apps are much larger than they should be)
+ target_link_libraries(${target} "-Wl,--gc-sections")
target_link_libraries(${target} "-Wl,--start-group")
target_link_libraries(${target} ${libraries})
message(STATUS "Component libraries: ${IDF_COMPONENT_LIBRARIES}")
function(idf_import_components var idf_path build_path)
add_subdirectory(${idf_path} ${build_path})
set(${var} ${BUILD_COMPONENTS} PARENT_SCOPE)
-endfunction()
\ No newline at end of file
+endfunction()
set(mapfile "${CMAKE_PROJECT_NAME}.map")
- target_link_libraries(${IDF_PROJECT_EXECUTABLE} "-Wl,--gc-sections \
- -Wl,--cref -Wl,--Map=${mapfile}")
+ target_link_libraries(${IDF_PROJECT_EXECUTABLE} "-Wl,--cref -Wl,--Map=${mapfile}")
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES