From 903b5439ba604aff0686a9eead18f9b3533490ce Mon Sep 17 00:00:00 2001 From: dpeter99 Date: Sun, 18 Oct 2020 18:27:07 +0200 Subject: [PATCH] Fix building on Windows by dpeter99 Fix CMake invocation that confused it into using Visual Studio build tools.. --- CMakeLists.txt | 9 +++------ chroma/inc/kernel/chroma.h | 3 ++- chroma/kernel.c | 2 +- pre.sh | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 274bf14..7b15e04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ #project config cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_COMPILER x86_64-elf-gcc) + # cheat the compile test set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) SET(CMAKE_SYSTEM_NAME Generic) @@ -52,9 +55,3 @@ add_executable(kernel) target_sources(kernel PUBLIC ${src_preamble} PUBLIC ${src_files} PUBLIC ${src_no_sse} PUBLIC ${lib_files} PUBLIC ${CMAKE_SOURCE_DIR}/font.o PUBLIC ${src_epilogue}) target_compile_options(kernel PRIVATE -ffreestanding -O2 -Wall -Wextra -Wall -Werror -pedantic -fPIC -fno-exceptions ) target_link_options(kernel PRIVATE -T linker.ld -ffreestanding -O2 -nostdlib -nostartfiles -lgcc) - -add_custom_command( - TARGET kernel -# POST_BUILD -# COMMAND bash post.sh -) diff --git a/chroma/inc/kernel/chroma.h b/chroma/inc/kernel/chroma.h index 7ae00e8..5186271 100644 --- a/chroma/inc/kernel/chroma.h +++ b/chroma/inc/kernel/chroma.h @@ -19,7 +19,8 @@ #include #include -#include +//Removed cause "wacky copyrighted stuff" +//#include extern size_t LoadAddr; extern bootinfo bootldr; diff --git a/chroma/kernel.c b/chroma/kernel.c index 0e5765b..2295469 100644 --- a/chroma/kernel.c +++ b/chroma/kernel.c @@ -1,5 +1,5 @@ #include -#include +//#include /************************ *** Team Kitty, 2020 *** diff --git a/pre.sh b/pre.sh index 033bf72..66ba57f 100644 --- a/pre.sh +++ b/pre.sh @@ -1,3 +1,3 @@ #!/bin/sh x86_64-elf-ld -r -b binary -o font.o font.psf -cmake -DCMAKE_C_COMPILER=x86_64-elf-gcc . +cmake -G"Unix Makefiles" .