am-kernels/kernels/yield-os/CMakeLists.txt

11 lines
475 B
CMake

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)