add_executable(am-tests
    tests/audio/audio-data.S
    tests/audio.c
    tests/devscan.c
    tests/hello.c
    tests/intr.c
    tests/keyboard.c
    tests/mp.c
    tests/rtc.c
    tests/video.c
    tests/vm.c
    main.c
)
# set_property(SOURCE tests/audio/audio-data.S APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/audio/little-star.pcm)

target_include_directories(am-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../include)
target_link_libraries(am-tests PRIVATE am-${ARCH} klib npcgcc)

# -- Extract binary file from ELF
add_custom_command(TARGET am-tests
    COMMAND ${CMAKE_OBJCOPY} ARGS  -S --set-section-flags .bss=alloc,contents -O binary am-tests am-tests.bin)

install(TARGETS am-tests RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/am-kernels)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/am-tests.bin DESTINATION ${CMAKE_INSTALL_DATADIR}/am-kernels)
