diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bd9348cb57e..c2b73040bc4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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})