2022-11-13 09:09:09 +00:00
|
|
|
cmake_minimum_required(VERSION 3.8..3.22)
|
|
|
|
|
|
|
|
set(CMAKE_C_COMPILER_WORKS 1)
|
|
|
|
set(CMAKE_CXX_COMPILER_WORKS 1)
|
|
|
|
|
|
|
|
set(CMAKE_CROSSCOMPILING true)
|
|
|
|
|
2024-09-07 15:17:08 +00:00
|
|
|
project(Luna LANGUAGES C CXX ASM ASM_NASM VERSION 0.7.0)
|
|
|
|
set(LUNA_RELEASE_NAME "Pulsar")
|
2022-11-13 09:09:09 +00:00
|
|
|
|
|
|
|
set(LUNA_ROOT ${CMAKE_CURRENT_LIST_DIR})
|
2023-01-06 12:31:14 +00:00
|
|
|
set(LUNA_BASE ${CMAKE_CURRENT_LIST_DIR}/base)
|
2022-11-13 09:09:09 +00:00
|
|
|
|
2023-01-21 21:44:16 +00:00
|
|
|
set(LUNA_ARCH $ENV{LUNA_ARCH})
|
2022-11-19 16:46:53 +00:00
|
|
|
|
2023-01-21 21:44:16 +00:00
|
|
|
if(NOT DEFINED LUNA_ARCH)
|
|
|
|
set(LUNA_ARCH "x86_64")
|
2022-12-05 15:36:41 +00:00
|
|
|
endif()
|
|
|
|
|
2023-01-21 21:44:16 +00:00
|
|
|
set(CMAKE_C_COMPILER ${LUNA_ARCH}-luna-gcc)
|
|
|
|
set(CMAKE_CXX_COMPILER ${LUNA_ARCH}-luna-g++)
|
|
|
|
set(CMAKE_ASM_COMPILER ${LUNA_ARCH}-luna-gcc)
|
2022-12-30 10:48:18 +00:00
|
|
|
|
|
|
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
|
|
|
|
|
2023-01-21 21:44:16 +00:00
|
|
|
set(CMAKE_ASM_NASM_LINK_EXECUTABLE "${LUNA_ARCH}-luna-ld <FLAGS> <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
2022-12-30 10:48:18 +00:00
|
|
|
|
2023-01-21 21:44:16 +00:00
|
|
|
set(CMAKE_FIND_ROOT_PATH ${LUNA_ROOT}/toolchain/${LUNA_ARCH}-luna)
|
2022-12-30 10:48:18 +00:00
|
|
|
|
2023-01-21 21:44:16 +00:00
|
|
|
message(STATUS "Configuring Luna for ${LUNA_ARCH}")
|
2022-11-19 16:46:53 +00:00
|
|
|
|
2023-04-07 10:02:49 +00:00
|
|
|
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
|
2023-07-24 13:06:48 +00:00
|
|
|
-Wredundant-decls -Wshadow -Wconversion -Wbidi-chars=any
|
2023-04-07 10:02:49 +00:00
|
|
|
-fno-asynchronous-unwind-tables -fno-omit-frame-pointer
|
|
|
|
-std=c++20 -fno-rtti -fno-exceptions)
|
|
|
|
|
2023-04-07 10:07:08 +00:00
|
|
|
if(LUNA_NO_OPTIMIZATIONS)
|
|
|
|
set(COMMON_FLAGS ${COMMON_FLAGS} -ggdb)
|
|
|
|
else()
|
|
|
|
set(COMMON_FLAGS ${COMMON_FLAGS} -Os)
|
|
|
|
endif()
|
|
|
|
|
2023-02-27 14:19:18 +00:00
|
|
|
add_subdirectory(libluna)
|
2023-03-29 16:27:02 +00:00
|
|
|
add_subdirectory(libos)
|
2024-07-21 11:24:46 +00:00
|
|
|
add_subdirectory(gui)
|
2023-01-06 12:31:14 +00:00
|
|
|
add_subdirectory(libc)
|
2022-12-23 12:09:21 +00:00
|
|
|
add_subdirectory(kernel)
|
2024-07-21 11:24:46 +00:00
|
|
|
add_subdirectory(utils)
|
2023-04-23 19:52:28 +00:00
|
|
|
add_subdirectory(tests)
|
2023-07-21 18:44:01 +00:00
|
|
|
add_subdirectory(shell)
|
2024-07-21 11:24:46 +00:00
|
|
|
add_subdirectory(system)
|