cmake: Use variables for target names

There is an effort underway to make most of the Zephyr build script's
reentrant. Meaning, the build scripts can be executed multiple times
during the same CMake invocation.

Reentrancy enables several use-cases, the motivating one is the
ability to build several Zephyr executables, or images, for instance a
bootloader and an application.

For build scripts to be reentrant they cannot be directly referencing
global variables, like target names, but must instead reference
variables, which can vary from entry to entry.

Therefore, in this patch, we replace global targets with variables.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2019-01-14 16:39:33 +01:00 committed by Anas Nashif
parent 45857563ff
commit 73f7e81d21
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ endif (WITH_DEFAULT_LOGGER)
if (WITH_ZEPHYR)
zephyr_library_named(metal)
add_dependencies(metal offsets_h)
add_dependencies(metal ${OFFSETS_H_TARGET})
zephyr_library_sources(${_sources})
zephyr_include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
else (WITH_ZEPHYR)