From a44e2f41fe3774a9671059b13ac8156b0034a0cc Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 19 Nov 2022 17:59:39 +0100 Subject: [PATCH] Cleanup kernel/CMakeLists.txt --- kernel/CMakeLists.txt | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 0db461df..f2cbf6cc 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -1,8 +1,8 @@ set(SOURCES src/main.cpp - src/Framebuffer.cpp - src/MemoryManager.cpp - src/Init.cpp + src/video/Framebuffer.cpp + src/memory/MemoryManager.cpp + src/boot/Init.cpp src/arch/Serial.cpp ) @@ -16,21 +16,14 @@ set(SOURCES ) endif() -set(ASM_SOURCES) - -if("${ARCH}" MATCHES "x86_64") -set(ASM_SOURCES - ${ASM_SOURCES} - src/arch/x86_64/CPU.asm -) - -add_library(moon-asm STATIC ${ASM_SOURCES}) -endif() - add_executable(moon ${SOURCES}) if("${ARCH}" MATCHES "x86_64") -target_link_libraries(moon moon-asm) + set(ASM_SOURCES + src/arch/x86_64/CPU.asm + ) + add_library(moon-asm STATIC ${ASM_SOURCES}) + target_link_libraries(moon moon-asm) endif() target_link_libraries(moon luna-freestanding) @@ -48,16 +41,13 @@ target_compile_options(moon PRIVATE -fno-asynchronous-unwind-tables -fno-omit-fr target_compile_options(moon PRIVATE -nostdlib -mcmodel=kernel) if("${ARCH}" MATCHES "x86_64") -target_compile_options(moon PRIVATE -mno-red-zone) -target_compile_options(moon PRIVATE -mno-80387 -mno-mmx -mno-sse -mno-sse2) + target_compile_options(moon PRIVATE -mno-red-zone) + target_compile_options(moon PRIVATE -mno-80387 -mno-mmx -mno-sse -mno-sse2) + target_link_options(moon PRIVATE -mno-red-zone) endif() target_link_options(moon PRIVATE -lgcc -Wl,--build-id=none -z max-page-size=0x1000 -mcmodel=kernel) -if("${ARCH}" MATCHES "x86_64") -target_link_options(moon PRIVATE -mno-red-zone) -endif() - set_target_properties(moon PROPERTIES CXX_STANDARD 20) target_include_directories(moon PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src)