Skip to content

Commit

Permalink
cmake: Configure custom linker script Kconfig before usage
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nordicjm authored and kartben committed Jan 10, 2025
1 parent 50bcb12 commit 2e43656
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 2e43656

Please sign in to comment.