cmake: qemu: Support delayed expansion of QEMU_KERNEL_OPTION
This commit allows the `QEMU_KERNEL_OPTION` variable, which can be overridden by the `board.cmake`, to contain references to the variables that are not available at the time of `board.cmake` inclusion, by expanding its escpaed variable references in `cmake/emu/qemu.cmake` which is included nearby the end of the root `CMakeLists.txt`. With this change, the `board.cmake` can escape variable references as follows and allow them to be expanded later: set(QEMU_KERNEL_OPTION "-device;loader,file=\$<TARGET_FILE:$\{...}>") Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
parent
95bdbe35bd
commit
19965f8173
2 changed files with 3 additions and 1 deletions
|
@ -14,7 +14,7 @@ set(QEMU_FLAGS_${ARCH}
|
||||||
)
|
)
|
||||||
|
|
||||||
set(QEMU_KERNEL_OPTION
|
set(QEMU_KERNEL_OPTION
|
||||||
"-device;loader,file=$<TARGET_FILE:zephyr_final>,cpu-num=4"
|
"-device;loader,file=\$<TARGET_FILE:\${logical_target_for_zephyr_elf}>,cpu-num=4"
|
||||||
"-device;loader,addr=0xff5e023c,data=0x80008fde,data-len=4"
|
"-device;loader,addr=0xff5e023c,data=0x80008fde,data-len=4"
|
||||||
"-device;loader,addr=0xff9a0000,data=0x80000218,data-len=4"
|
"-device;loader,addr=0xff9a0000,data=0x80000218,data-len=4"
|
||||||
)
|
)
|
||||||
|
|
|
@ -298,6 +298,8 @@ if(DEFINED QEMU_KERNEL_FILE)
|
||||||
set(QEMU_KERNEL_OPTION "-kernel;${QEMU_KERNEL_FILE}")
|
set(QEMU_KERNEL_OPTION "-kernel;${QEMU_KERNEL_FILE}")
|
||||||
elseif(NOT DEFINED QEMU_KERNEL_OPTION)
|
elseif(NOT DEFINED QEMU_KERNEL_OPTION)
|
||||||
set(QEMU_KERNEL_OPTION "-kernel;$<TARGET_FILE:${logical_target_for_zephyr_elf}>")
|
set(QEMU_KERNEL_OPTION "-kernel;$<TARGET_FILE:${logical_target_for_zephyr_elf}>")
|
||||||
|
elseif(DEFINED QEMU_KERNEL_OPTION)
|
||||||
|
string(CONFIGURE "${QEMU_KERNEL_OPTION}" QEMU_KERNEL_OPTION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(target ${qemu_targets})
|
foreach(target ${qemu_targets})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue