cmake: Configure custom linker script Kconfig before usage
Allows having CMake variables inside of this Kconfig to e.g. use a value that can specify a board directory or path relative to a CMake file location variable Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
parent
50bcb122e8
commit
2e436564a6
1 changed files with 3 additions and 3 deletions
|
@ -1109,10 +1109,10 @@ set_ifndef( TOPT "${COMPILER_TOPT}")
|
|||
set_ifndef( TOPT -Wl,-T) # Use this if the compiler driver doesn't set a value
|
||||
|
||||
if(CONFIG_HAVE_CUSTOM_LINKER_SCRIPT)
|
||||
set(LINKER_SCRIPT ${APPLICATION_SOURCE_DIR}/${CONFIG_CUSTOM_LINKER_SCRIPT})
|
||||
string(CONFIGURE ${APPLICATION_SOURCE_DIR}/${CONFIG_CUSTOM_LINKER_SCRIPT} LINKER_SCRIPT)
|
||||
if(NOT EXISTS ${LINKER_SCRIPT})
|
||||
set(LINKER_SCRIPT ${CONFIG_CUSTOM_LINKER_SCRIPT})
|
||||
assert_exists(CONFIG_CUSTOM_LINKER_SCRIPT)
|
||||
string(CONFIGURE ${CONFIG_CUSTOM_LINKER_SCRIPT} LINKER_SCRIPT)
|
||||
assert_exists(LINKER_SCRIPT)
|
||||
endif()
|
||||
elseif(DEFINED BOARD_LINKER_SCRIPT)
|
||||
set(LINKER_SCRIPT ${BOARD_LINKER_SCRIPT})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue