From affc068544bdc3030004045e95f4425d39600063 Mon Sep 17 00:00:00 2001 From: silverqx Date: Wed, 3 Jul 2024 22:22:47 +0200 Subject: [PATCH] Revert "cmake used function() instead of macro()" It must be macro() because the cmake_dependent_option() sets a local variable when the is FALSE, what means, if this is the function() the variable will be undefined outside the scope. This reverts commit dc24dd41334378b3b0596002f754f914fe53853a. --- cmake/CommonModules/TinyFeatureOptions.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/CommonModules/TinyFeatureOptions.cmake b/cmake/CommonModules/TinyFeatureOptions.cmake index 7c138eb09..d87706757 100644 --- a/cmake/CommonModules/TinyFeatureOptions.cmake +++ b/cmake/CommonModules/TinyFeatureOptions.cmake @@ -33,7 +33,7 @@ endfunction() include(CMakeDependentOption) # Helper function for coupling cmake_dependent_option() and add_feature_info() -function(feature_option_dependent name description default depends force) +macro(feature_option_dependent name description default depends force) string(CONCAT desc "${description} (default: ${default}; depends on condition: ${depends})") @@ -42,7 +42,7 @@ function(feature_option_dependent name description default depends force) add_feature_info(${name} ${name} "${desc}") -endfunction() +endmacro() # Macro to provide a STRING type option dependent on other options. # This macro works the same and as the cmake_dependent_option() but it's for the STRING