add_library("kernel-objs" OBJECT # Platform-independent KAPI implementation "kapi/boot_modules.cpp" "kapi/cio.cpp" "kapi/cpu.cpp" "kapi/interrupts.cpp" "kapi/memory.cpp" "kapi/system.cpp" # KSTD OS Implementation "kstd/os.cpp" "kstd/print.cpp" # Kernel Implementation "src/main.cpp" "src/memory/bitmap_allocator.cpp" "src/memory/block_list_allocator.cpp" "src/memory/operators.cpp" "src/memory.cpp" "src/devices/block_device.cpp" "src/devices/block_device_utils.cpp" "src/devices/storage/controller.cpp" "src/devices/storage/management.cpp" "src/devices/storage/ram_disk/controller.cpp" "src/devices/storage/ram_disk/device.cpp" "src/filesystem/devfs/filesystem.cpp" "src/filesystem/devfs/inode.cpp" "src/filesystem/ext2/filesystem.cpp" "src/filesystem/ext2/inode.cpp" "src/filesystem/dentry.cpp" "src/filesystem/device_inode.cpp" "src/filesystem/file_descriptor_table.cpp" "src/filesystem/filesystem.cpp" "src/filesystem/inode.cpp" "src/filesystem/mount_table.cpp" "src/filesystem/mount.cpp" "src/filesystem/open_file_description.cpp" "src/filesystem/rootfs/filesystem.cpp" "src/filesystem/rootfs/inode.cpp" "src/filesystem/vfs.cpp" ) target_include_directories("kernel-objs" PUBLIC "include" ) target_link_libraries("kernel-objs" PRIVATE "os::kapi" ) file(GLOB_RECURSE KERNEL_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "include/**.hpp") target_sources("kernel-objs" PUBLIC FILE_SET HEADERS BASE_DIRS "include" FILES ${KERNEL_HEADERS} ) add_executable("kernel" $ ) target_link_libraries("kernel" PRIVATE "os::arch" ) target_link_options("kernel" PRIVATE "-T${KERNEL_LINKER_SCRIPT}" "-no-pie" "-nostdlib" ) set_property(TARGET "kernel" APPEND PROPERTY LINK_DEPENDS "${KERNEL_LINKER_SCRIPT}" ) target_disassemble("kernel") target_extract_debug_symbols("kernel") target_strip("kernel") target_generate_bootable_iso("kernel")