From f79d0f2f318c5ad1329f2d3c26a23b96eff40a82 Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Thu, 16 Jul 2026 11:06:16 +0700 Subject: Processing feature variables policy change Feature is enable if variable FEATURE_ defines and it caches, and it judges as **enable**. It influences the FEATURE__IS_ENABLE field in `CMakeFeature.out` and runfile generation files - all the **enable** features are mention direct or indirect now. Signed-off-by: Alexey Gavrilov --- cmake/module/feature.cmake | 2 +- cmake/module/runfile.cmake | 28 +++++++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/cmake/module/feature.cmake b/cmake/module/feature.cmake index 380a88d..d97761b 100644 --- a/cmake/module/feature.cmake +++ b/cmake/module/feature.cmake @@ -240,7 +240,7 @@ createFeatureModuleFunction("outFeaturesToFile" "" endforeach() # Check if feature is enable, and push them to file - if("FEATURE_\${feature}" IN_LIST cacheVars AND NOT "\${FEATURE_\${feature}}" STREQUAL "") + if("FEATURE_\${feature}" IN_LIST cacheVars AND DEFINED "\${FEATURE_\${feature}}") file(APPEND "\${OUT_FILE}" "FEATURE_\${feature}_IS_ENABLING = " "\\"TRUE\\"\n") endif() diff --git a/cmake/module/runfile.cmake b/cmake/module/runfile.cmake index a861b9a..86c7493 100644 --- a/cmake/module/runfile.cmake +++ b/cmake/module/runfile.cmake @@ -1,13 +1,27 @@ -get_property(IS_INITIALIZED GLOBAL PROPERTY CONFFILE_MODULE SET) +#[[ + # Copyright (c) 2026 Alexey Gavrilov + # + # This file is part of ObjectiveOS. + # + # ObjectiveOS is free software: you can redistribute it and/or modify it under + # the terms of the GNU General Public License as published by the Free Software + # Foundation, either version 3 of the License, or (at your option) any later + # version. + # + # ObjectiveOS is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License along with + # ObjectiveOS. If not, see . + ]] -if(NOT IS_INITIALIZED) - set_property(GLOBAL PROPERTY CONFFILE_MODULE TRUE) - set(CONFFILE_NAME "CMakeFeaturesDefineEnum.txt" CACHE STRING "Build configuration - file contains cmake run command to reproduce last run") -endif() +include_guard(GLOBAL) + +set(CONFFILE_NAME "CMakeFeaturesDefineEnum.txt" CACHE STRING "Build configuration +file contains cmake run command to reproduce last run") macro(convertCacheVarIntoArg var cachelist outfile) - if("${var}" IN_LIST ${cachelist} AND NOT "${${var}}" STREQUAL "") + if("${var}" IN_LIST ${cachelist} AND DEFINED "${${var}}") file(APPEND ${${outfile}} " -D${var}=${${var}}") endif() endmacro() -- cgit v1.2.3