2023-03-08 18:53:39 +00:00
|
|
|
cmake_minimum_required(VERSION 3.00)
|
2023-01-25 11:22:27 +00:00
|
|
|
project(NoxOS)
|
2023-04-20 21:00:56 +00:00
|
|
|
set(C 99)
|
|
|
|
|
|
|
|
set(CMAKE_NASM_COMPILE_OBJECT "nasm <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
|
|
|
|
|
|
|
|
|
|
|
|
add_executable(kernel)
|
|
|
|
add_library (kernel_asm OBJECT)
|
|
|
|
target_include_directories(kernel PRIVATE inc)
|
|
|
|
file(GLOB_RECURSE kernel_src_c "src/**/*.c")
|
|
|
|
file(GLOB_RECURSE kernel_inc "inc/**/*.h")
|
|
|
|
file(GLOB_RECURSE kernel_src_asm "src/**/*.asm")
|
|
|
|
|
|
|
|
|
|
|
|
target_compile_options(kernel PRIVATE -g -fno-stack-protector -fno-stack-check -mno-red-zone -ffreestanding -m64 -march=x86-64 -mabi=sysv)
|
|
|
|
target_link_options(kernel PRIVATE -nostdlib -static -T "${CMAKE_CURRENT_LIST_DIR}/kernel.ld")
|
|
|
|
|
|
|
|
enable_language(ASM_NASM)
|
|
|
|
set(CAN_USE_ASSEMBLER TRUE)
|
|
|
|
|
|
|
|
target_sources(kernel_asm PRIVATE ${kernel_src_asm})
|
|
|
|
target_sources(kernel PRIVATE ${kernel_src_c} ${kernel_inc} $<TARGET_OBJECTS:kernel_asm>)
|
|
|
|
|
2023-01-24 21:39:50 +00:00
|
|
|
|