cmake: lds headers dependency

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This commit is contained in:
Janusz Jankowski 2019-02-22 00:18:05 +01:00 committed by Marcin Maka
parent 4d715e060d
commit 9327ca524a
1 changed files with 5 additions and 1 deletions

View File

@ -102,13 +102,17 @@ function(sof_add_ld_script binary_name script_name)
get_target_property(incdirs sof_options INTERFACE_INCLUDE_DIRECTORIES)
set(iflags "")
set(glob_predicates "")
foreach(d ${incdirs})
list(APPEND iflags "-I${d}")
list(APPEND glob_predicates "${d}/*.h")
endforeach()
file(GLOB lds_headers ${glob_predicates})
add_custom_command(OUTPUT ${lds_out}
COMMAND ${CMAKE_C_COMPILER} -E -P ${iflags} -o ${lds_out} -x c ${lds_in}
DEPENDS ${lds_in} ${LINK_DEPS} genconfig ${CONFIG_H_PATH}
DEPENDS ${lds_in} ${LINK_DEPS} genconfig ${CONFIG_H_PATH} ${lds_headers}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Generating linker script: ${lds_out}"
VERBATIM