feat: added cross compiler and moved headers to include dir

This commit is contained in:
2021-03-09 19:45:20 +01:00
parent cefdb8ed90
commit dc4bf71b5a
77 changed files with 180 additions and 45 deletions

View File

@@ -1,12 +1,20 @@
cmake_minimum_required(VERSION 3.15)
project(new_kernel C ASM)
# Define compiler run time
SET(COMPILER_RT ${CMAKE_CURRENT_LIST_DIR}/compiler/target/bin)
SET(CMAKE_C_COMPILER ${COMPILER_RT}/i686-elf-gcc)
SET(CMAKE_ASM_COMPILER ${COMPILER_RT}/i686-elf-gcc)
# Optionally enable cmake debugging
#SET(CMAKE_VERBOSE_MAKEFILE ON)
SET(GCC_INCLUDE_DIR "/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include")
SET(CMAKE_C_FLAGS "-I${GCC_INCLUDE_DIR} -mno-sse -g -ffreestanding -Wall -Wextra -fno-exceptions -fno-stack-protector -nostdinc -nostdlib -fno-pie -m32")
# Set compile flags
SET(CMAKE_C_FLAGS "-g -ffreestanding -Wall -Wextra -fno-exceptions -fno-stack-protector -fno-pie -m32")
SET(CMAKE_ASM_FLAGS "${CFLAGS} -m32 -x assembler-with-cpp")
SET(CMAKE_EXE_LINKER_FLAGS "-T${CMAKE_CURRENT_LIST_DIR}/linker.ld -lgcc -ffreestanding -nostdlib -no-pie")
include_directories(AFTER kernel boot)
include_directories(AFTER include)
set(CMAKE_C_STANDARD 99)