Skip to content

Commit 24c862c

Browse files
mbolivar-nordicSebastianBoe
authored andcommitted
cmake: move flash/debug/run state to target properties
The BOARD_RUNNER_ARGS_<runner> and ZEPHYR_RUNNERS variables are really about the particular zephyr image that's being compiled: they're specific to the board and even the application. The same is true of the QEMU_FLAGS_${ARCH} and QEMU_CPU_TYPE_${ARCH} variables set in various board files. Make all of this state ZEPHYR_TARGET properties. This also lets us move some qemu-specific stuff out of boilerplate.cmake into qemu.cmake. Signed-off-by: Marti Bolivar <[email protected]> Signed-off-by: Sebastian Bøe <[email protected]>
1 parent 17d8bfb commit 24c862c

File tree

16 files changed

+75
-70
lines changed

16 files changed

+75
-70
lines changed

boards/arm/mps2_an385/board.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
set(EMU_PLATFORM qemu)
44

5-
set(QEMU_CPU_TYPE_${ARCH} cortex-m3)
6-
set(QEMU_FLAGS_${ARCH}
7-
-cpu ${QEMU_CPU_TYPE_${ARCH}}
5+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_CPU_TYPE_${ARCH} cortex-m3)
6+
set_property(TARGET ${ZEPHYR_TARGET} PROPERTY QEMU_FLAGS_${ARCH}
7+
-cpu cortex-m3
88
-machine mps2-an385
99
-nographic
1010
-vga none

boards/arm/mps2_an521/board.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
set(EMU_PLATFORM qemu)
44

5-
set(QEMU_CPU_TYPE_${ARCH} cortex-m33)
6-
set(QEMU_FLAGS_${ARCH}
7-
-cpu ${QEMU_CPU_TYPE_${ARCH}}
5+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_CPU_TYPE_${ARCH} cortex-m33)
6+
set_property(TARGET ${ZEPHYR_TARGET} PROPERTY QEMU_FLAGS_${ARCH}
7+
-cpu cortex-m33
88
-machine mps2-an521
99
-nographic
1010
-m 16

boards/arm/qemu_cortex_m0/board.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
set(EMU_PLATFORM qemu)
77

8-
set(QEMU_CPU_TYPE_${ARCH} cortex-m0)
9-
set(QEMU_FLAGS_${ARCH}
10-
-cpu ${QEMU_CPU_TYPE_${ARCH}}
8+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_CPU_TYPE_${ARCH} cortex-m0)
9+
set_property(TARGET ${ZEPHYR_TARGET} PROPERTY QEMU_FLAGS_${ARCH}
10+
-cpu cortex-m0
1111
-machine microbit
1212
-nographic
1313
-vga none

boards/arm/qemu_cortex_m3/board.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
set(EMU_PLATFORM qemu)
44

5-
set(QEMU_CPU_TYPE_${ARCH} cortex-m3)
6-
set(QEMU_FLAGS_${ARCH}
7-
-cpu ${QEMU_CPU_TYPE_${ARCH}}
5+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_CPU_TYPE_${ARCH} cortex-m3)
6+
set_property(TARGET ${ZEPHYR_TARGET} PROPERTY QEMU_FLAGS_${ARCH}
7+
-cpu cortex-m3
88
-machine lm3s6965evb
99
-nographic
1010
-vga none

boards/arm/qemu_cortex_r5/board.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
set(EMU_PLATFORM qemu)
66
set(QEMU_ARCH aarch64)
77

8-
set(QEMU_CPU_TYPE_${ARCH} cortex-r5)
9-
set(QEMU_FLAGS_${ARCH}
8+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_CPU_TYPE_${ARCH} cortex-r5)
9+
set_property(TARGET ${ZEPHYR_TARGET} PROPERTY QEMU_FLAGS_${ARCH}
1010
-nographic
1111
-machine xlnx-zcu102
1212
-global xlnx,zynqmp.boot-cpu="rpu-cpu[0]"

boards/nios2/qemu_nios2/board.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
set(EMU_PLATFORM qemu)
44

5-
set(QEMU_CPU_TYPE_${ARCH} nios2)
6-
7-
set(QEMU_FLAGS_${ARCH}
5+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_CPU_TYPE_${ARCH} nios2)
6+
set_property(TARGET ${ZEPHYR_TARGET} PROPERTY QEMU_FLAGS_${ARCH}
87
-machine altera_10m50_zephyr
98
-nographic
109
)

boards/riscv/hifive1/board.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
set(EMU_PLATFORM qemu)
44

5-
set(QEMU_CPU_TYPE_${ARCH} riscv32)
6-
7-
set(QEMU_FLAGS_${ARCH}
5+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_CPU_TYPE_${ARCH} riscv32)
6+
set_property(TARGET ${ZEPHYR_TARGET} PROPERTY QEMU_FLAGS_${ARCH}
87
-nographic
98
-machine sifive_e
109
)

boards/riscv/qemu_riscv32/board.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
set(EMU_PLATFORM qemu)
44

5-
set(QEMU_binary_suffix riscv32)
6-
set(QEMU_CPU_TYPE_${ARCH} riscv32)
7-
8-
set(QEMU_FLAGS_${ARCH}
5+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_binary_suffix riscv32)
6+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_CPU_TYPE_${ARCH} riscv32)
7+
set_property(TARGET ${ZEPHYR_TARGET} PROPERTY QEMU_FLAGS_${ARCH}
98
-nographic
109
-machine sifive_e
1110
)

boards/riscv/qemu_riscv64/board.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
set(EMU_PLATFORM qemu)
44

5-
set(QEMU_binary_suffix riscv64)
6-
set(QEMU_CPU_TYPE_${ARCH} riscv64)
7-
8-
set(QEMU_FLAGS_${ARCH}
5+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_binary_suffix riscv64)
6+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_CPU_TYPE_${ARCH} riscv64)
7+
set_property(TARGET ${ZEPHYR_TARGET} PROPERTY QEMU_FLAGS_${ARCH}
98
-nographic
109
-machine sifive_e
1110
)

boards/x86/qemu_x86/board.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ if(NOT CONFIG_REBOOT)
77
endif()
88

99
if(CONFIG_X86_LONGMODE)
10-
set(QEMU_binary_suffix x86_64)
10+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_binary_suffix x86_64)
11+
endif()
12+
13+
if(CONFIG_X86_LONGMODE)
1114
set(QEMU_CPU_TYPE_${ARCH} qemu64,+x2apic)
1215
else()
1316
set(QEMU_CPU_TYPE_${ARCH} qemu32,+nx,+pae)
1417
endif()
1518

16-
set(QEMU_FLAGS_${ARCH}
19+
set_target_properties(${ZEPHYR_TARGET} PROPERTIES QEMU_CPU_TYPE_${ARCH} ${QEMU_CPU_TYPE_${ARCH}})
20+
set_property(TARGET ${ZEPHYR_TARGET} PROPERTY QEMU_FLAGS_${ARCH}
1721
-m 9
1822
-cpu ${QEMU_CPU_TYPE_${ARCH}}
1923
-device isa-debug-exit,iobase=0xf4,iosize=0x04

0 commit comments

Comments
 (0)