diff options
| author | Alexey Gavrilov <alexey.gavrilov@mail.com> | 2026-07-23 14:37:44 +0700 |
|---|---|---|
| committer | Alexey Gavrilov <alexey.gavrilov@mail.com> | 2026-07-23 17:55:20 +0700 |
| commit | ccb9dbd3f78d9f06826560bd54519bab3477947a (patch) | |
| tree | 70a5a4ddb9ff59ba334000c0c87d1e0299b408a7 /drivers/acpi/CMakeLists.txt | |
| parent | bfab70232fb99d08131c0da3a95b98174e107999 (diff) | |
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 <alexey.gavrilov@mail.com>
Diffstat (limited to 'drivers/acpi/CMakeLists.txt')
| -rw-r--r-- | drivers/acpi/CMakeLists.txt | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/drivers/acpi/CMakeLists.txt b/drivers/acpi/CMakeLists.txt index 35c1d7b..55f0f3c 100644 --- a/drivers/acpi/CMakeLists.txt +++ b/drivers/acpi/CMakeLists.txt @@ -16,20 +16,41 @@ * ObjectiveOS. If not, see <https://www.gnu.org/licenses/>. ]] -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) +set(IS_ACPI_DEFINES TRUE) +ifFeatureEnables(MSR IS_ACPI_DEFINES) + +if(NOT IS_ACPI_DEFINES) + add_library(ACPI INTERFACE) +else() + target_compile_definitions(CXX_COMPILER_REQUIREMENTS INTERFACE + FEATURE_ACPI + ) + + 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) +endif() + +startFeatureRecording(ACPI) + +setFeatureField(NAME "ACPI tables") +setFeatureField(HASHCOMMIT "515a11b818e4140845f69bb26a19d270a9e42178") +setFeatureField(DESCRIPTION "ACPI tables support") +setFeatureField(TAGS "NEW") +setFeatureField(AUTHORSHIP "Alexey Gavrilov <alexey.gavrilov@mail.com>") + +saveFeaturerecording() |
