28 lines
1.3 KiB
CMake
28 lines
1.3 KiB
CMake
#
|
|
# shadeOS Build System
|
|
#
|
|
cmake_minimum_required(VERSION 3.10)
|
|
project(shadeOS LANGUAGES C ASM_NASM)
|
|
|
|
# Configure CFLAGS
|
|
set(CMAKE_C_FLAGS -ffreestanding)
|
|
set(CMAKE_LINKER x86_64-elf-ld)
|
|
set(CMAKE_C_COMPILER x86_64-elf-gcc)
|
|
set(CMAKE_ASM_NASM_LINK_EXECUTABLE "<CMAKE_LINKER> <FLAGS> <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
|
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> -n <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
|
|
|
# Configure versioning info
|
|
set(SHADE_KERNEL_VERSION "0.1.1-alpha")
|
|
set(SHADE_RELEASE_STREAM "shade-development")
|
|
execute_process(COMMAND "git rev-parse --short HEAD | tr -d '\n'" SHADE_GIT_BUILD)
|
|
execute_process(COMMAND "date | tr -d '\n'" OUTPUT_VARIABLE SHADE_COMPILE_DATE)
|
|
set(SHADE_CODENAME willow)
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/libc)
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/kernel)
|
|
|
|
# Generate the iso
|
|
#add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/shadeOS.iso COMMAND ${CMAKE_SOURCE_DIR}/shade-build/mkiso.sh ${CMAKE_CURRENT_BINARY_DIR}/shadeOS.bin ${CMAKE_CURRENT_SOURCE_DIR}/../iso/ ${CMAKE_CURRENT_BINARY_DIR}/shadeOS.iso ${CMAKE_SOURCE_DIR}/shade-build/checkbin.sh)
|
|
|
|
# Add target to run the file
|
|
#add_custom_target(run COMMAND ${CMAKE_SOURCE_DIR}/shade-build/run_qemu.sh DEPENDS shadeOS.iso WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |