cmake: Allow deps to be added to the preprocessing of LD scripts
To be able to correctly express that preprocessing a file will depend on targets and files we enhance the LD script preprocessing function by adding all trailing arguments to the DEPENDS section of the custom command. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
parent
7a6afcdc04
commit
b43c6120ab
|
@ -426,6 +426,7 @@ endif()
|
||||||
configure_file(version.h.in ${PROJECT_BINARY_DIR}/include/generated/version.h)
|
configure_file(version.h.in ${PROJECT_BINARY_DIR}/include/generated/version.h)
|
||||||
|
|
||||||
function(construct_add_custom_command_for_linker_pass linker_output_name output_variable)
|
function(construct_add_custom_command_for_linker_pass linker_output_name output_variable)
|
||||||
|
set(extra_dependencies ${ARGN})
|
||||||
set(linker_cmd_file_name ${linker_output_name}.cmd)
|
set(linker_cmd_file_name ${linker_output_name}.cmd)
|
||||||
|
|
||||||
if (${linker_output_name} MATCHES "^linker_pass_final$")
|
if (${linker_output_name} MATCHES "^linker_pass_final$")
|
||||||
|
@ -458,6 +459,7 @@ function(construct_add_custom_command_for_linker_pass linker_output_name output_
|
||||||
OUTPUT ${linker_cmd_file_name}
|
OUTPUT ${linker_cmd_file_name}
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${LINKER_SCRIPT}
|
${LINKER_SCRIPT}
|
||||||
|
${extra_dependencies}
|
||||||
# NB: 'linker_script_dep' will use a keyword that ends 'DEPENDS'
|
# NB: 'linker_script_dep' will use a keyword that ends 'DEPENDS'
|
||||||
${linker_script_dep}
|
${linker_script_dep}
|
||||||
COMMAND ${CMAKE_C_COMPILER}
|
COMMAND ${CMAKE_C_COMPILER}
|
||||||
|
|
Loading…
Reference in a new issue