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 /arch/x86/ic/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 'arch/x86/ic/CMakeLists.txt')
| -rw-r--r-- | arch/x86/ic/CMakeLists.txt | 54 |
1 files changed, 38 insertions, 16 deletions
diff --git a/arch/x86/ic/CMakeLists.txt b/arch/x86/ic/CMakeLists.txt index b724a64..cdb30c3 100644 --- a/arch/x86/ic/CMakeLists.txt +++ b/arch/x86/ic/CMakeLists.txt @@ -16,19 +16,41 @@ * ObjectiveOS. If not, see <https://www.gnu.org/licenses/>. ]] -add_library(IC STATIC) -target_link_libraries(IC PUBLIC CXX_COMPILER_REQUIREMENTS) - -target_sources(IC PRIVATE - ${CMAKE_CURRENT_LIST_DIR}/Pic.cpp -) - -target_sources(IC - PUBLIC - FILE_SET HEADERS - FILES - ${CMAKE_CURRENT_LIST_DIR}/Pic.h - ${CMAKE_CURRENT_LIST_DIR}/IPic.h -) - -target_link_libraries(Architecture INTERFACE IC) +set(IS_PIC_DEFINES TRUE) +ifFeatureEnables(PIC IS_PIC_DEFINES) + +if(NOT IS_PIC_DEFINES) + add_library(PIC INTERFACE) +else() + target_compile_definitions(CXX_COMPILER_REQUIREMENTS INTERFACE + FEATURE_PIC + ) + + add_library(PIC STATIC) + target_link_libraries(PIC PUBLIC CXX_COMPILER_REQUIREMENTS) + + target_sources(PIC PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/Pic.cpp + ) + + target_sources(PIC + PUBLIC + FILE_SET HEADERS + FILES + ${CMAKE_CURRENT_LIST_DIR}/Pic.h + ${CMAKE_CURRENT_LIST_DIR}/IPic.h + ) + + target_link_libraries(Architecture INTERFACE PIC) +endif() + +startFeatureRecording(PIC) + +setFeatureField(NAME "PIC support") +setFeatureField(HASHCOMMIT "515a11b818e4140845f69bb26a19d270a9e42178") +setFeatureField(DESCRIPTION "PIC x86 support") +setFeatureField(TAGS "NEW") +setFeatureField(AUTHORSHIP "Alexey Gavrilov <alexey.gavrilov@mail.com>") +setFeatureDependencies("x86;ACPI") + +saveFeaturerecording() |
