From 4c83f456ab082af4802a227d8381b5696998f781 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Tue, 27 Nov 2018 13:26:15 +0800 Subject: [PATCH] cmake: generate sections info for all static libs as in make --- tools/cmake/components.cmake | 2 ++ tools/cmake/ldgen.cmake | 5 +++++ 2 files changed, 7 insertions(+) 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( -- 2.40.0