aboutsummaryrefslogtreecommitdiff
path: root/source/CMakeLists.txt
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2023-10-11 14:43:50 +0200
committerFelix Morgner <felix.morgner@ost.ch>2023-10-11 14:43:50 +0200
commit74eaee0fcc7390d4290b41a2a92ee34346e2f7c2 (patch)
tree3a38f8dbe0c6b757167bc264cb68e3da145bd069 /source/CMakeLists.txt
parentf47bee5f51a73593d3594940663f56f2427f480b (diff)
downloadteachos-74eaee0fcc7390d4290b41a2a92ee34346e2f7c2.tar.xz
teachos-74eaee0fcc7390d4290b41a2a92ee34346e2f7c2.zip
teachos: restructure file layout
Diffstat (limited to 'source/CMakeLists.txt')
-rw-r--r--source/CMakeLists.txt60
1 files changed, 58 insertions, 2 deletions
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 326fc8d..15b4016 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -7,8 +7,64 @@ project("kernel"
LANGUAGES ASM C CXX
)
+#[============================================================================[
+# Global Build System Configuration
+#]============================================================================]
+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
+set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES)
+
+#[============================================================================[
+# Global Compiler Configuration
+#]============================================================================]
+
+add_compile_options(
+ "$<$<CXX_COMPILER_ID:GNU>:-Wall>"
+ "$<$<CXX_COMPILER_ID:GNU>:-Wextra>"
+ "$<$<CXX_COMPILER_ID:GNU>:-Werror>"
+ "$<$<CXX_COMPILER_ID:GNU>:-pedantic-errors>"
+)
+
+#[============================================================================[
+# Global Directories
+#]============================================================================]
+
+include_directories(
+ "include"
+ "arch/${CMAKE_SYSTEM_PROCESSOR}/include"
+)
+
+#[============================================================================[
+# The Bootstrap Library
+#]============================================================================]
+
+add_library("_boot" OBJECT)
+add_library("teachos::boot" ALIAS "_boot")
+
+#[============================================================================[
+# The Video Library
+#]============================================================================]
+
+add_library("_video" OBJECT)
+add_library("teachos::video" ALIAS "_video")
+
+#[============================================================================[
+# The Kernel
+#]============================================================================]
+
+add_executable("_kernel"
+ "src/kernel/main.cpp"
+)
+add_executable("teachos::kernel" ALIAS "_kernel")
+
+target_link_libraries("_kernel" PRIVATE
+ "teachos::boot"
+ "teachos::video"
+)
+
+#[============================================================================[
+# Platform Specific Components
+#]============================================================================]
-add_subdirectory("boot")
-add_subdirectory("kernel")
+add_subdirectory("arch/${CMAKE_SYSTEM_PROCESSOR}")