build: add more tests to build system
This commit is contained in:
parent
2f559823a6
commit
9d41ac2f7b
12 changed files with 107 additions and 17 deletions
14
kernels/hello/CMakeLists.txt
Normal file
14
kernels/hello/CMakeLists.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
add_executable(hello
|
||||
hello.c
|
||||
)
|
||||
target_include_directories(hello PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||
target_link_libraries(hello PRIVATE am-${ARCH} klib npcgcc)
|
||||
target_compile_options(hello PRIVATE -nostdlib -nodefaultlibs)
|
||||
target_link_options(hello PRIVATE -nostdlib -nodefaultlibs)
|
||||
|
||||
# -- Extract binary file from ELF
|
||||
add_custom_command(TARGET hello
|
||||
COMMAND ${CMAKE_OBJCOPY} ARGS -S --set-section-flags .bss=alloc,contents -O binary hello hello.bin)
|
||||
|
||||
install(TARGETS hello RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/am-kernels)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/hello.bin DESTINATION ${CMAKE_INSTALL_DATADIR}/am-kernels)
|
Loading…
Add table
Add a link
Reference in a new issue