Skip to content

Commit

Permalink
Revert "cmake used function() instead of macro()"
Browse files Browse the repository at this point in the history
It must be macro() because the cmake_dependent_option() sets a local
variable when the <depends> is FALSE, what means, if this is
the function() the variable will be undefined outside the scope.

This reverts commit dc24dd4.
  • Loading branch information
silverqx committed Jul 3, 2024
1 parent b7e82dd commit affc068
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/CommonModules/TinyFeatureOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})")
Expand All @@ -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
Expand Down

0 comments on commit affc068

Please sign in to comment.