41 lines
1.4 KiB
CMake
41 lines
1.4 KiB
CMake
set(SOURCES
|
|
src/main.cpp
|
|
src/string.cpp
|
|
src/Framebuffer.cpp
|
|
src/MemoryManager.cpp
|
|
src/Init.cpp
|
|
src/arch/Serial.cpp
|
|
)
|
|
|
|
set(SOURCES
|
|
${SOURCES}
|
|
src/arch/x86_64/IO.cpp
|
|
src/arch/x86_64/Serial.cpp
|
|
src/arch/x86_64/MMU.cpp
|
|
)
|
|
|
|
add_compile_options(-Os)
|
|
|
|
add_compile_options(-pedantic -Wall -Wextra -Werror -Wvla)
|
|
add_compile_options(-Wdisabled-optimization -Wformat=2 -Winit-self)
|
|
add_compile_options(-Wmissing-include-dirs -Wswitch-default -Wcast-qual -Wundef)
|
|
add_compile_options(-Wcast-align -Wwrite-strings -Wlogical-op -Wredundant-decls -Wshadow -Wconversion)
|
|
add_compile_options(-fno-rtti -ffreestanding -fno-exceptions)
|
|
add_compile_options(-fno-asynchronous-unwind-tables -fno-omit-frame-pointer)
|
|
add_compile_options(-nostdlib -mcmodel=kernel)
|
|
add_compile_options(-mno-red-zone)
|
|
|
|
add_compile_options(-mno-80387 -mno-mmx -mno-sse -mno-sse2)
|
|
|
|
add_link_options(-lgcc -Wl,--build-id=none -z max-page-size=0x1000 -mno-red-zone -mcmodel=kernel)
|
|
|
|
add_executable(moon ${SOURCES})
|
|
|
|
set_target_properties(moon PROPERTIES CXX_STANDARD 20)
|
|
|
|
target_include_directories(moon PUBLIC ${LUNA_ROOT}/luna)
|
|
target_include_directories(moon PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src)
|
|
|
|
target_link_options(moon PRIVATE LINKER:-T ${CMAKE_CURRENT_LIST_DIR}/moon.ld -nostdlib -nodefaultlibs)
|
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/moon" DESTINATION ${LUNA_ROOT}/initrd/boot) |