Skip to content

Commit 51e9ae3

Browse files
committed
semihost: Clean up cmake build for arm
Make it possible to build the other targets by having the machine bits control whether the general arm semihost files are built. Signed-off-by: Keith Packard <[email protected]>
1 parent 6e87530 commit 51e9ae3

File tree

2 files changed

+45
-41
lines changed

2 files changed

+45
-41
lines changed

semihost/CMakeLists.txt

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -43,45 +43,47 @@ target_include_directories(semihost SYSTEM PUBLIC ${PICOLIBC_INCLUDE_DIRECTORIES
4343

4444
add_subdirectory(machine/${CMAKE_SYSTEM_PROCESSOR})
4545

46-
target_sources(semihost PRIVATE
47-
close.c
48-
exit.c
49-
fstat.c
50-
gettimeofday.c
51-
isatty.c
52-
kill.c
53-
lseek.c
54-
lseek64.c
55-
mapstdio.c
56-
open.c
57-
read.c
58-
unlink.c
59-
write.c
60-
sys_clock.c
61-
sys_close.c
62-
sys_elapsed.c
63-
sys_errno.c
64-
sys_exit.c
65-
sys_exit_extended.c
66-
sys_feature.c
67-
sys_flen.c
68-
sys_get_cmdline.c
69-
sys_getc.c
70-
sys_heapinfo.c
71-
sys_iserror.c
72-
sys_istty.c
73-
sys_open.c
74-
sys_putc.c
75-
sys_read.c
76-
sys_remove.c
77-
sys_rename.c
78-
sys_seek.c
79-
sys_system.c
80-
sys_tickfreq.c
81-
sys_time.c
82-
sys_tmpnam.c
83-
sys_write.c
84-
sys_write0.c
85-
iob.c
86-
)
46+
if(DEFINED _SEMIHOST_ARM)
47+
target_sources(semihost PRIVATE
48+
close.c
49+
exit.c
50+
fstat.c
51+
gettimeofday.c
52+
isatty.c
53+
kill.c
54+
lseek.c
55+
lseek64.c
56+
mapstdio.c
57+
open.c
58+
read.c
59+
unlink.c
60+
write.c
61+
sys_clock.c
62+
sys_close.c
63+
sys_elapsed.c
64+
sys_errno.c
65+
sys_exit.c
66+
sys_exit_extended.c
67+
sys_feature.c
68+
sys_flen.c
69+
sys_get_cmdline.c
70+
sys_getc.c
71+
sys_heapinfo.c
72+
sys_iserror.c
73+
sys_istty.c
74+
sys_open.c
75+
sys_putc.c
76+
sys_read.c
77+
sys_remove.c
78+
sys_rename.c
79+
sys_seek.c
80+
sys_system.c
81+
sys_tickfreq.c
82+
sys_time.c
83+
sys_tmpnam.c
84+
sys_write.c
85+
sys_write0.c
86+
iob.c
87+
)
88+
endif()
8789

semihost/machine/arm/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@
3434
#
3535

3636
target_sources(semihost PRIVATE semihost-arm.S)
37+
38+
set(_SEMIHOST_ARM 1 PARENT_SCOPE)

0 commit comments

Comments
 (0)