Skip to content

Commit 2796032

Browse files
committed
target/xtensa: list cores in a text file
Avoid that leftover files affect the build; instead, use the same mechanism that was in place before the Meson transition of updating a file from import_core.sh. Starting with Meson 0.57, the file can be easily read from the filesystem module, so do that instead of using run_command. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 0a11c44 commit 2796032

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

target/xtensa/cores.list

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
core-dc232b.c
2+
core-dc233c.c
3+
core-de212.c
4+
core-de233_fpu.c
5+
core-dsp3400.c
6+
core-fsf.c
7+
core-sample_controller.c
8+
core-test_kc705_be.c
9+
core-test_mmuhifi_c3.c

target/xtensa/import_core.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ static XtensaConfig $NAME __attribute__((unused)) = {
6666
6767
REGISTER_CORE($NAME)
6868
EOF
69+
70+
grep -qxf core-${NAME}.c "$BASE"/cores.list || \
71+
echo core-${NAME}.c >> "$BASE"/cores.list

target/xtensa/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
xtensa_ss = ss.source_set()
22

3-
xtensa_cores = run_command('sh', '-c', 'cd $MESON_SOURCE_ROOT/$MESON_SUBDIR ; ls -1 core-*.c')
4-
xtensa_ss.add(files(xtensa_cores.stdout().strip().split('\n')))
3+
xtensa_cores = fs.read('cores.list')
4+
xtensa_ss.add(files(xtensa_cores.strip().split('\n')))
55

66
xtensa_ss.add(files(
77
'cpu.c',

0 commit comments

Comments
 (0)