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)
|
|
|
|
|
2023-01-06 12:31:14 +00:00
|
|
|
project(Luna LANGUAGES C CXX ASM ASM_NASM VERSION 0.1.0)
|
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
|
|
|
|
2022-11-19 16:46:53 +00:00
|
|
|
set(ARCH $ENV{ARCH})
|
|
|
|
|
2023-01-06 17:59:59 +00:00
|
|
|
if(NOT DEFINED ARCH)
|
2022-12-05 15:36:41 +00:00
|
|
|
set(ARCH "x86_64")
|
|
|
|
endif()
|
|
|
|
|
2022-12-30 10:48:18 +00:00
|
|
|
set(CMAKE_C_COMPILER ${ARCH}-luna-gcc)
|
|
|
|
set(CMAKE_CXX_COMPILER ${ARCH}-luna-g++)
|
2023-01-06 12:31:14 +00:00
|
|
|
set(CMAKE_ASM_COMPILER ${ARCH}-luna-gcc)
|
2022-12-30 10:48:18 +00:00
|
|
|
|
|
|
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
|
|
|
|
|
|
|
|
set(CMAKE_ASM_NASM_LINK_EXECUTABLE "${ARCH}-luna-ld <FLAGS> <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
|
|
|
|
2023-01-06 16:35:07 +00:00
|
|
|
set(CMAKE_FIND_ROOT_PATH ${LUNA_ROOT}/toolchain/x86_64-luna)
|
2022-12-30 10:48:18 +00:00
|
|
|
|
2022-11-19 16:46:53 +00:00
|
|
|
message(STATUS "Configuring Luna for ${ARCH}")
|
|
|
|
|
2022-11-19 14:43:09 +00:00
|
|
|
add_subdirectory(luna)
|
2023-01-06 12:31:14 +00:00
|
|
|
add_subdirectory(libc)
|
2022-12-23 12:09:21 +00:00
|
|
|
add_subdirectory(kernel)
|
2023-01-06 12:31:14 +00:00
|
|
|
add_subdirectory(apps)
|