Luna/CMakeLists.txt
apio 140910763e
All checks were successful
Build and test / build (push) Successful in 1m56s
all: Reorder directory structure
Why are command-line utilities stored in "apps"?
And why are apps like "editor" or "terminal" top-level directories?
Command-line utilities now go in "utils".
GUI stuff now goes in "gui".
This includes: libui -> gui/libui, wind -> gui/wind, GUI apps -> gui/apps, editor&terminal -> gui/apps...
System services go in "system".
2024-07-21 13:24:46 +02:00

55 lines
1.5 KiB
CMake

cmake_minimum_required(VERSION 3.8..3.22)
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_CROSSCOMPILING true)
project(Luna LANGUAGES C CXX ASM ASM_NASM VERSION 0.6.0)
set(LUNA_RELEASE_NAME "Andromeda")
set(LUNA_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(LUNA_BASE ${CMAKE_CURRENT_LIST_DIR}/base)
set(LUNA_ARCH $ENV{LUNA_ARCH})
if(NOT DEFINED LUNA_ARCH)
set(LUNA_ARCH "x86_64")
endif()
set(CMAKE_C_COMPILER ${LUNA_ARCH}-luna-gcc)
set(CMAKE_CXX_COMPILER ${LUNA_ARCH}-luna-g++)
set(CMAKE_ASM_COMPILER ${LUNA_ARCH}-luna-gcc)
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
set(CMAKE_ASM_NASM_LINK_EXECUTABLE "${LUNA_ARCH}-luna-ld <FLAGS> <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
set(CMAKE_FIND_ROOT_PATH ${LUNA_ROOT}/toolchain/${LUNA_ARCH}-luna)
message(STATUS "Configuring Luna for ${LUNA_ARCH}")
set(COMMON_FLAGS -Wall -Wextra -Werror -Wvla
-Wdisabled-optimization -Wformat=2 -Winit-self
-Wmissing-include-dirs -Wswitch-default -Wcast-qual
-Wundef -Wcast-align -Wwrite-strings -Wlogical-op
-Wredundant-decls -Wshadow -Wconversion -Wbidi-chars=any
-fno-asynchronous-unwind-tables -fno-omit-frame-pointer
-std=c++20 -fno-rtti -fno-exceptions)
if(LUNA_NO_OPTIMIZATIONS)
set(COMMON_FLAGS ${COMMON_FLAGS} -ggdb)
else()
set(COMMON_FLAGS ${COMMON_FLAGS} -Os)
endif()
add_subdirectory(libluna)
add_subdirectory(libos)
add_subdirectory(gui)
add_subdirectory(libc)
add_subdirectory(kernel)
add_subdirectory(utils)
add_subdirectory(tests)
add_subdirectory(shell)
add_subdirectory(system)