From ccb9dbd3f78d9f06826560bd54519bab3477947a Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Thu, 23 Jul 2026 14:37:44 +0700 Subject: Include cmake feature module in the build routine Add predicate `ifFeatureEnables` that checks feature is define or not, and return accordingly boolean value. Consider some cmake objective targets as features. Populate information to these targets, and provides in particular file `CMakeFeatures.txt`. Cpuid, MSR, ACPI and driver VGA in text mode they are. Signed-off-by: Alexey Gavrilov --- kernel/details/CMakeLists.txt | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'kernel/details') diff --git a/kernel/details/CMakeLists.txt b/kernel/details/CMakeLists.txt index ceab7f6..1ecfc06 100644 --- a/kernel/details/CMakeLists.txt +++ b/kernel/details/CMakeLists.txt @@ -16,11 +16,16 @@ * ObjectiveOS. If not, see . ]] -target_sources(CPUID - PUBLIC - FILE_SET HEADERS - BASE_DIRS - ${CMAKE_CURRENT_LIST_DIR} - FILES - ${CMAKE_CURRENT_LIST_DIR}/Platform.h -) +set(IS_CPUID_DEFINES TRUE) +ifFeatureEnables(CPUID IS_CPUID_DEFINES) + +if(IS_CPUID_DEFINES) + target_sources(CPUID + PUBLIC + FILE_SET HEADERS + BASE_DIRS + ${CMAKE_CURRENT_LIST_DIR} + FILES + ${CMAKE_CURRENT_LIST_DIR}/Platform.h + ) +endif() -- cgit v1.2.3