cmake: Fix CONFIG_CUSTOM_LINKER_SCRIPT

Specifying a custom linker script is supposed to be supported through
Kconfig, but evidently this has been unused and 100% broken at least
since the CMake migration.

This commit fixes
https://github.com/zephyrproject-rtos/zephyr/issues/6983

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2018-04-12 14:48:05 +02:00 committed by Anas Nashif
parent 8c5b16cc79
commit c1aa9d16e9

View file

@ -265,11 +265,9 @@ zephyr_ld_options(
if(CONFIG_HAVE_CUSTOM_LINKER_SCRIPT)
set(LINKER_SCRIPT ${APPLICATION_SOURCE_DIR}/${CONFIG_CUSTOM_LINKER_SCRIPT})
if(NOT EXISTS LINKER_SCRIPT)
if(NOT EXISTS ${LINKER_SCRIPT})
set(LINKER_SCRIPT ${CONFIG_CUSTOM_LINKER_SCRIPT})
if(NOT EXISTS LINKER_SCRIPT)
message(FATAL_ERROR "CONFIG_HAVE_CUSTOM_LINKER_SCRIPT was set, but no linker script was found at '${CONFIG_CUSTOM_LINKER_SCRIPT}'")
endif()
assert_exists(CONFIG_CUSTOM_LINKER_SCRIPT)
endif()
else()
# Try a board specific linker file