From 6ffe96d1e3f0289c2070e050cf8e1a30288e6d91 Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Fri, 27 Mar 2026 14:03:55 +0700 Subject: Cmake build generator support: build stage Multi-target architecture implementation: each root source code directory presents the one *INTERFACE* target to it's subdirectory subtargets that link only as *STATIC* library. For instance, *arch* directory presents *Architecture* target then *Architecture* target has *CPUID*, *IO*, *PORT* and etc. dependencies Exact order of linking targets is: boot.o CRTIBUNDLE CRTNBUNDLE. Sequence destruction cause to UB. Please to pay attention to this. TODO - Debug information - Build type - Toolchain file - Image creation - Build by WinGW compiler on Windows platform (optional) Signed-off-by: Alexey Gavrilov --- drivers/CMakeLists.txt | 3 +++ drivers/acpi/Acpi.h | 2 +- drivers/acpi/CMakeLists.txt | 17 +++++++++++++++++ drivers/acpi/Ics.h | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 drivers/CMakeLists.txt create mode 100644 drivers/acpi/CMakeLists.txt (limited to 'drivers') diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt new file mode 100644 index 0000000..c11b75f --- /dev/null +++ b/drivers/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(Drivers INTERFACE) + +add_subdirectory(acpi) diff --git a/drivers/acpi/Acpi.h b/drivers/acpi/Acpi.h index 506ab99..d9dc378 100644 --- a/drivers/acpi/Acpi.h +++ b/drivers/acpi/Acpi.h @@ -1,4 +1,4 @@ -#include +#include #include #include "Ics.h" diff --git a/drivers/acpi/CMakeLists.txt b/drivers/acpi/CMakeLists.txt new file mode 100644 index 0000000..32f2fac --- /dev/null +++ b/drivers/acpi/CMakeLists.txt @@ -0,0 +1,17 @@ +add_library(ACPI STATIC) +target_link_libraries(ACPI PUBLIC CXX_COMPILER_REQUIREMENTS) + +target_sources(ACPI PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/Acpi.cpp + ${CMAKE_CURRENT_LIST_DIR}/Ics.cpp +) + +target_sources(ACPI + PUBLIC + FILE_SET HEADERS + FILES + ${CMAKE_CURRENT_LIST_DIR}/Acpi.h + ${CMAKE_CURRENT_LIST_DIR}/Ics.h +) + +target_link_libraries(Drivers INTERFACE ACPI) diff --git a/drivers/acpi/Ics.h b/drivers/acpi/Ics.h index 8289c90..b4e38d4 100644 --- a/drivers/acpi/Ics.h +++ b/drivers/acpi/Ics.h @@ -1,4 +1,4 @@ -#include +#include class Ics -- cgit v1.2.3