2023-05-17 20:20:53 -07:00
|
|
|
cmake_minimum_required(VERSION 3.2)
|
|
|
|
|
|
|
|
# Set because our cross compiler can't do dynamic linking?
|
|
|
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
|
|
|
|
|
|
|
|
project(AcadiaOS VERSION 0.0.1 LANGUAGES CXX ASM-ATT)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS True)
|
|
|
|
|
2023-06-07 11:09:27 -07:00
|
|
|
set(BASE_COMPILE_FLAGS "-ffreestanding -fno-exceptions -mgeneral-regs-only")
|
|
|
|
set(BASE_LINK_FLAGS "-nostdlib")
|
|
|
|
|
2023-05-17 20:20:53 -07:00
|
|
|
add_subdirectory(zion)
|
2023-06-06 16:56:19 -07:00
|
|
|
add_subdirectory(lib)
|
2023-05-29 00:32:54 -07:00
|
|
|
add_subdirectory(sys)
|
2023-05-17 20:20:53 -07:00
|
|
|
|
2023-06-07 16:24:13 -07:00
|
|
|
# Use machine q35 to access PCI devices.
|
|
|
|
set(QEMU_CMD qemu-system-x86_64 -machine q35 -d guest_errors -m 1G -serial stdio -hda disk.img)
|
2023-05-30 23:22:52 -07:00
|
|
|
|
2023-05-17 20:20:53 -07:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT disk.img
|
|
|
|
COMMAND sudo sh ../scripts/build_image.sh disk.img
|
2023-06-08 02:36:59 -07:00
|
|
|
DEPENDS zion yellowstone denali
|
2023-05-17 20:20:53 -07:00
|
|
|
USES_TERMINAL
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(qemu
|
2023-05-30 23:22:52 -07:00
|
|
|
COMMAND ${QEMU_CMD}
|
2023-05-17 22:46:19 -07:00
|
|
|
DEPENDS disk.img
|
|
|
|
USES_TERMINAL)
|
|
|
|
|
|
|
|
add_custom_target(qemu-dbg
|
2023-05-30 23:22:52 -07:00
|
|
|
COMMAND ${QEMU_CMD} -S -s
|
|
|
|
DEPENDS disk.img
|
|
|
|
USES_TERMINAL)
|
|
|
|
|
|
|
|
add_custom_target(qemu-int
|
|
|
|
COMMAND ${QEMU_CMD} -d int
|
2023-05-17 20:20:53 -07:00
|
|
|
DEPENDS disk.img
|
|
|
|
USES_TERMINAL)
|