build: add more tests to build system

This commit is contained in:
xinyangli 2024-07-09 17:42:46 +08:00
parent 2f559823a6
commit 9d41ac2f7b
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
12 changed files with 107 additions and 17 deletions

View file

@ -0,0 +1,3 @@
include_directories(include)
add_subdirectory(src)

View file

@ -0,0 +1,23 @@
add_executable(bench
qsort/qsort.c
ssort/ssort.cc
queen/queen.c
sieve/sieve.c
bf/bf.c
15pz/15pz.cc
dinic/dinic.cc
lzip/lzip.c
lzip/quicklz.c
md5/md5.c
bench.c
fib/fib.c
)
target_link_libraries(bench am-${ARCH} klib npcgcc)
# -- Extract binary file from ELF
add_custom_command(TARGET bench
COMMAND ${CMAKE_OBJCOPY} ARGS -S --set-section-flags .bss=alloc,contents -O binary bench bench.bin)
install(TARGETS bench RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/am-kernels)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bench.bin DESTINATION ${CMAKE_INSTALL_DATADIR}/am-kernels)