cmake: generate sections info for all static libs as in make

This commit is contained in:
Renz Christian Bagaporo 2018-11-27 13:26:15 +08:00
parent a9c784339d
commit 4c83f456ab
2 changed files with 7 additions and 0 deletions

View file

@ -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)

View file

@ -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(