am-tests,microbench,yield-os: CMake support

This commit is contained in:
xinyangli 2024-08-13 20:24:57 +08:00
parent 02b38e7b44
commit 0b911f75ce
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
13 changed files with 496 additions and 14 deletions

View file

@ -1,2 +1,3 @@
add_subdirectory(hello)
add_subdirectory(demo)
add_subdirectory(yield-os)

View file

@ -0,0 +1,11 @@
add_executable(yield-os
yield-os.c
)
target_link_libraries(yield-os PRIVATE am-${ARCH} klib npcgcc)
# -- Extract binary file from ELF
add_custom_command(TARGET yield-os
COMMAND ${CMAKE_OBJCOPY} ARGS -S --set-section-flags .bss=alloc,contents -O binary yield-os yield-os.bin)
install(TARGETS yield-os RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/am-kernels)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/yield-os.bin DESTINATION ${CMAKE_INSTALL_DATADIR}/am-kernels)