summaryrefslogtreecommitdiffstats
path: root/arch/x86/io/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexey Gavrilov <alexey.gavrilov@mail.com>2026-07-23 14:37:44 +0700
committerAlexey Gavrilov <alexey.gavrilov@mail.com>2026-07-23 17:55:20 +0700
commitccb9dbd3f78d9f06826560bd54519bab3477947a (patch)
tree70a5a4ddb9ff59ba334000c0c87d1e0299b408a7 /arch/x86/io/CMakeLists.txt
parentbfab70232fb99d08131c0da3a95b98174e107999 (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/io/CMakeLists.txt')
-rw-r--r--arch/x86/io/CMakeLists.txt55
1 files changed, 39 insertions, 16 deletions
diff --git a/arch/x86/io/CMakeLists.txt b/arch/x86/io/CMakeLists.txt
index 0686529..b63c4eb 100644
--- a/arch/x86/io/CMakeLists.txt
+++ b/arch/x86/io/CMakeLists.txt
@@ -16,19 +16,42 @@
* ObjectiveOS. If not, see <https://www.gnu.org/licenses/>.
]]
-add_library(IO STATIC)
-target_link_libraries(IO PUBLIC CXX_COMPILER_REQUIREMENTS)
-
-target_sources(IO PRIVATE
- ${CMAKE_CURRENT_LIST_DIR}/VGADisplay.cpp
-)
-
-target_sources(IO
- PUBLIC
- FILE_SET HEADERS
- FILES
- ${CMAKE_CURRENT_LIST_DIR}/VGADisplay.h
- ${CMAKE_CURRENT_LIST_DIR}/VGADisplayInfo.h
-)
-
-target_link_libraries(Architecture INTERFACE IO)
+set(IS_DISPLAY_DEFINES TRUE)
+ifFeatureEnables(DISPLAY IS_DISPLAY_DEFINES)
+
+if(NOT IS_DISPLAY_DEFINES)
+ add_library(DISPLAY INTERFACE)
+else()
+ target_compile_definitions(CXX_COMPILER_REQUIREMENTS INTERFACE
+ FEATURE_DISPLAY
+ )
+
+ add_library(DISPLAY STATIC)
+ target_link_libraries(DISPLAY PUBLIC CXX_COMPILER_REQUIREMENTS)
+
+ target_sources(DISPLAY PRIVATE
+ ${CMAKE_CURRENT_LIST_DIR}/VGADisplay.cpp
+ )
+
+ target_sources(DISPLAY
+ PUBLIC
+ FILE_SET HEADERS
+ FILES
+ ${CMAKE_CURRENT_LIST_DIR}/VGADisplay.h
+ ${CMAKE_CURRENT_LIST_DIR}/VGADisplayInfo.h
+ )
+
+ target_link_libraries(Architecture INTERFACE DISPLAY)
+endif()
+
+startFeatureRecording(DISPLAY)
+
+setFeatureField(NAME "VGA driver for x86 processors")
+setFeatureField(HASHCOMMIT "b82ccebd3a0cce28177b5fac046139e2de7737fa")
+setFeatureField(DESCRIPTION "Add ability to write into framebuffer"
+ "under the x86 processorҕ")
+setFeatureField(TAGS "NEW")
+setFeatureField(AUTHORSHIP "Alexey Gavrilov <alexey.gavrilov@mail.com>")
+setFeatureDependencies(x86)
+
+saveFeatureRecording()