From c84f8720b62288e8e0a537802e12131ca4713805 Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Thu, 16 Jul 2026 10:44:45 +0700 Subject: Cmake feature module duplicates check Signed-off-by: Alexey Gavrilov --- cmake/module/feature.cmake | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cmake/module/feature.cmake b/cmake/module/feature.cmake index c8dd56a..380a88d 100644 --- a/cmake/module/feature.cmake +++ b/cmake/module/feature.cmake @@ -52,6 +52,7 @@ createFeatureModuleFunction("featureModuleInitialization" "" CACHE STRING "Available feature fields")]] ) +# Run variable initialization if module is work. featureModuleInitialization() createFeatureModuleFunction("startFeatureRecording" "target" @@ -60,11 +61,24 @@ createFeatureModuleFunction("startFeatureRecording" "target" GLOBAL PROPERTY POPULATING_FEATURES ) + get_property( + FEATURES_LIST_PROPERTY + GLOBAL PROPERTY + FEATURES_LIST + ) + + # Process duplicating features. Error, if it is exists. + if( + target IN_LIST FEATURES_LIST_PROPERTY + OR target IN_LIST POPULATING_FEATURES_PROPERTY + ) + message(SEND_ERROR "\\"\${target}\\" feature is duplicate") + endif() if(TARGET \${target}) list(APPEND POPULATING_FEATURES_PROPERTY \${target}) else() - message(WARNING "\${target} isn't a target") + message(SEND_ERROR "\${target} isn't a target. Feature doesn't created.") endif() set_property( -- cgit v1.2.3