From: Renz Christian Bagaporo Date: Tue, 27 Nov 2018 05:26:15 +0000 (+0800) Subject: cmake: generate sections info for all static libs as in make X-Git-Tag: v3.3-beta1~56^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c83f456ab082af4802a227d8381b5696998f781;p=esp-idf cmake: generate sections info for all static libs as in make --- diff --git a/tools/cmake/components.cmake b/tools/cmake/components.cmake index cec0443589..82d0fbcaaa 100644 --- a/tools/cmake/components.cmake +++ b/tools/cmake/components.cmake @@ -62,6 +62,8 @@ function(register_component) set(include_type PUBLIC) set_property(TARGET ${COMPONENT_TARGET} PROPERTY OUTPUT_NAME ${COMPONENT_NAME}) + + ldgen_generate_sections_info(${COMPONENT_TARGET}) else() add_library(${COMPONENT_TARGET} INTERFACE) # header-only component set(include_type INTERFACE) diff --git a/tools/cmake/ldgen.cmake b/tools/cmake/ldgen.cmake index b69ff3bfbb..4dc405436e 100644 --- a/tools/cmake/ldgen.cmake +++ b/tools/cmake/ldgen.cmake @@ -22,7 +22,12 @@ function(ldgen_add_fragment_files target fragment_files) endforeach() set_property(TARGET ldgen APPEND PROPERTY FRAGMENT_FILES ${fragment_files_full_path}) +endfunction() +# ldgen_generate_sections_info +# +# Generate sections info for specified target to be used in linker script generation +function(ldgen_generate_sections_info target) get_filename_component(target_sections_info ${CMAKE_CURRENT_BINARY_DIR}/${target}.sections_info ABSOLUTE) add_custom_command(