From 25483b7af8df6b08d460f807fda04c6d409bd44e Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 14 Jul 2025 16:02:43 +0000 Subject: ide: start large-scale restructuring --- CMakeLists.txt | 268 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 142 insertions(+), 126 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 75ac1b5..e10da55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,138 +22,154 @@ set(CMAKE_CXX_STANDARD_REQUIRED YES) set(CMAKE_CXX_EXTENSIONS NO) #[============================================================================[ -# Documentation -#]============================================================================] - -find_package("Doxygen") - -set(DOXYGEN_GENERATE_HTML YES) -set(DOXYGEN_GENERATE_XML YES) -set(DOXYGEN_EXCLUDE_PATTERNS "*.cpp") -set(DOXYGEN_OUTPUT_DIRECTORY "doxygen") -set(DOXYGEN_QUIET YES) - -file(GLOB_RECURSE DOXYGEN_SOURCES CONFIGURE_DEPENDS "*.hpp") - -message(STATUS "${SPHINX_SOURCES}") - -doxygen_add_docs("docs_xml" - ${DOXYGEN_SOURCES} - ALL - USE_STAMP_FILE - COMMENT "Generating developer documentation sources" -) - -set_target_properties("docs_xml" PROPERTIES - ADDITIONAL_CLEAN_FILES - "${PROJECT_BINARY_DIR}/doxygen" -) - -file(GLOB_RECURSE SPHINX_SOURCES CONFIGURE_DEPENDS "../docs/**.rst") - -add_custom_target("docs" ALL - COMMAND "${SPHINX_BUILD_EXE}" - "../docs" - "docs" - "-q" - DEPENDS "docs_xml" - SOURCES ${SPHINX_SOURCES} - COMMENT "Generating developer documentation html" -) - -set_target_properties("docs" PROPERTIES - ADDITIONAL_CLEAN_FILES - "${PROJECT_BINARY_DIR}/docs" -) - -#[============================================================================[ -# Global Compiler Configuration -#]============================================================================] - -add_compile_options( - "$<$:-Wall>" - "$<$:-Wextra>" - "$<$:-Werror>" - "$<$:-pedantic-errors>" -) - -#[============================================================================[ -# Global Libraries +# Global Build System Configuration #]============================================================================] -add_subdirectory("libs/kstd" EXCLUDE_FROM_ALL SYSTEM) -add_subdirectory("libs/multiboot2" EXCLUDE_FROM_ALL SYSTEM) +add_subdirectory("libs") +add_subdirectory("kern") +add_subdirectory("arch") -#[============================================================================[ -# Global Directories -#]============================================================================] +add_executable("kernel") -include_directories( - "include" - "arch/${CMAKE_SYSTEM_PROCESSOR}/include" +target_link_libraries("kernel" PRIVATE + "kern" + "arch::all" + # "arch-${CMAKE_SYSTEM_PROCESSOR}" ) -#[============================================================================[ -# The Bootstrap Library -#]============================================================================] +# #[============================================================================[ +# # Documentation +# #]============================================================================] -add_library("_boot" OBJECT) -add_library("teachos::boot" ALIAS "_boot") +# find_package("Doxygen") -#[============================================================================[ -# The Video Library -#]============================================================================] - -add_library("_video" OBJECT) -add_library("teachos::video" ALIAS "_video") - -#[============================================================================[ -# THE Memory Library -#]============================================================================] - -add_library("_memory" OBJECT) -add_library("teachos::memory" ALIAS "_memory") - -#[============================================================================[ -# The Exception handling Library -#]============================================================================] - -add_library("_exception" OBJECT) -add_library("teachos::exception" ALIAS "_exception") - -#[============================================================================[ -# The Context switching Library -#]============================================================================] - -add_library("_context" OBJECT) -add_library("teachos::context_switching" ALIAS "_context") - -add_library("_interrupt_handling" OBJECT) -add_library("teachos::interrupt_handling" ALIAS "_interrupt_handling") -# https://forum.osdev.org/viewtopic.php?f=1&t=36712 -# https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html#index-interrupt-function-attribute_002c-x86 -target_compile_options("_interrupt_handling" PRIVATE "-mgeneral-regs-only") - -#[============================================================================[ -# The Kernel -#]============================================================================] - -add_executable("_kernel" - "src/kernel/main.cpp" -) -add_executable("teachos::kernel" ALIAS "_kernel") - -target_link_libraries("_kernel" PRIVATE - "teachos::boot" - "teachos::video" - "teachos::memory" - "teachos::exception" - "teachos::context_switching" - "teachos::interrupt_handling" -) - -#[============================================================================[ -# Platform Specific Components -#]============================================================================] +# set(DOXYGEN_GENERATE_HTML YES) +# set(DOXYGEN_GENERATE_XML YES) +# set(DOXYGEN_EXCLUDE_PATTERNS "*.cpp") +# set(DOXYGEN_OUTPUT_DIRECTORY "doxygen") +# set(DOXYGEN_QUIET YES) + +# file(GLOB_RECURSE DOXYGEN_SOURCES CONFIGURE_DEPENDS "*.hpp") -add_subdirectory("arch/${CMAKE_SYSTEM_PROCESSOR}") +# message(STATUS "${SPHINX_SOURCES}") + +# doxygen_add_docs("docs_xml" +# ${DOXYGEN_SOURCES} +# ALL +# USE_STAMP_FILE +# COMMENT "Generating developer documentation sources" +# ) + +# set_target_properties("docs_xml" PROPERTIES +# ADDITIONAL_CLEAN_FILES +# "${PROJECT_BINARY_DIR}/doxygen" +# ) + +# file(GLOB_RECURSE SPHINX_SOURCES CONFIGURE_DEPENDS "../docs/**.rst") + +# add_custom_target("docs" ALL +# COMMAND "${SPHINX_BUILD_EXE}" +# "../docs" +# "docs" +# "-q" +# DEPENDS "docs_xml" +# SOURCES ${SPHINX_SOURCES} +# COMMENT "Generating developer documentation html" +# ) + +# set_target_properties("docs" PROPERTIES +# ADDITIONAL_CLEAN_FILES +# "${PROJECT_BINARY_DIR}/docs" +# ) + +# #[============================================================================[ +# # Global Compiler Configuration +# #]============================================================================] + +# add_compile_options( +# "$<$:-Wall>" +# "$<$:-Wextra>" +# "$<$:-Werror>" +# "$<$:-pedantic-errors>" +# ) + +# #[============================================================================[ +# # Global Libraries +# #]============================================================================] + +# add_subdirectory("libs/kstd" EXCLUDE_FROM_ALL SYSTEM) +# add_subdirectory("libs/multiboot2" EXCLUDE_FROM_ALL SYSTEM) + +# #[============================================================================[ +# # 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 Memory Library +# #]============================================================================] + +# add_library("_memory" OBJECT) +# add_library("teachos::memory" ALIAS "_memory") + +# #[============================================================================[ +# # The Exception handling Library +# #]============================================================================] + +# add_library("_exception" OBJECT) +# add_library("teachos::exception" ALIAS "_exception") + +# #[============================================================================[ +# # The Context switching Library +# #]============================================================================] + +# add_library("_context" OBJECT) +# add_library("teachos::context_switching" ALIAS "_context") + +# add_library("_interrupt_handling" OBJECT) +# add_library("teachos::interrupt_handling" ALIAS "_interrupt_handling") +# # https://forum.osdev.org/viewtopic.php?f=1&t=36712 +# # https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html#index-interrupt-function-attribute_002c-x86 +# target_compile_options("_interrupt_handling" PRIVATE "-mgeneral-regs-only") + +# #[============================================================================[ +# # The Kernel +# #]============================================================================] + +# add_executable("_kernel" +# "src/kernel/main.cpp" +# ) +# add_executable("teachos::kernel" ALIAS "_kernel") + +# target_link_libraries("_kernel" PRIVATE +# "teachos::boot" +# "teachos::video" +# "teachos::memory" +# "teachos::exception" +# "teachos::context_switching" +# "teachos::interrupt_handling" +# ) + +# #[============================================================================[ +# # Platform Specific Components +# #]============================================================================] + +# add_subdirectory("arch/${CMAKE_SYSTEM_PROCESSOR}") -- cgit v1.2.3