diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-03-26 16:54:07 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-03-27 07:02:35 +0100 |
| commit | a2834cc22b096e848448bb681ab7b517ecbe70b9 (patch) | |
| tree | 9d9116c2ca021f38761095f73812538db29e7646 | |
| parent | f4dc64976049761a6f56dd55d9d0b651f1e9475f (diff) | |
| download | teachos-a2834cc22b096e848448bb681ab7b517ecbe70b9.tar.xz teachos-a2834cc22b096e848448bb681ab7b517ecbe70b9.zip | |
build: simplify header scanning
| -rw-r--r-- | CMakeLists.txt | 4 | ||||
| -rw-r--r-- | kapi/CMakeLists.txt | 17 | ||||
| -rw-r--r-- | kernel/CMakeLists.txt | 9 |
3 files changed, 16 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index febcf0e..d785d4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,10 @@ option(TEACHOS_GENERATE_DOCS "Generate documentation during build" ON) # Global Build System Configuration #]============================================================================] +if(POLICY CMP0209) + cmake_policy(SET CMP0209 NEW) +endif() + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES) diff --git a/kapi/CMakeLists.txt b/kapi/CMakeLists.txt index 99b737c..c9aa23f 100644 --- a/kapi/CMakeLists.txt +++ b/kapi/CMakeLists.txt @@ -1,24 +1,13 @@ add_library("kapi" INTERFACE) add_library("os::kapi" ALIAS "kapi") +file(GLOB_RECURSE KAPI_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "include/**.hpp") + target_sources("kapi" PUBLIC FILE_SET HEADERS BASE_DIRS "include" FILES - "include/kapi/boot_modules.hpp" - "include/kapi/boot.hpp" - "include/kapi/cio.hpp" - "include/kapi/cpu.hpp" - "include/kapi/interrupts.hpp" - "include/kapi/boot_module/boot_module.hpp" - "include/kapi/boot_module/boot_module_registry.hpp" - "include/kapi/memory.hpp" - "include/kapi/memory/address.hpp" - "include/kapi/memory/frame_allocator.hpp" - "include/kapi/memory/frame.hpp" - "include/kapi/memory/page_mapper.hpp" - "include/kapi/memory/page.hpp" - "include/kapi/system.hpp" + ${KAPI_HEADERS} ) target_include_directories("kapi" INTERFACE diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 535c441..3d3c7e2 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -56,6 +56,15 @@ set_property(TARGET "kernel" "${KERNEL_LINKER_SCRIPT}" ) +file(GLOB_RECURSE KERNEL_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "include/**.hpp") + +target_sources("kernel" PUBLIC + FILE_SET HEADERS + BASE_DIRS "include" + FILES + ${KERNEL_HEADERS} +) + target_disassemble("kernel") target_extract_debug_symbols("kernel") target_strip("kernel") |
