cmake,change_config_and_warn: return if feature=value
if the feature is already set to the required value avoid outputting a
spurious warning about changing it.
Change-Id: I7e104ff0ab1acc7e68f35ecc141d2ecbfa1c4643
diff --git a/build/cmake/aom_experiment_deps.cmake b/build/cmake/aom_experiment_deps.cmake
index cf4a270..e2c8102 100644
--- a/build/cmake/aom_experiment_deps.cmake
+++ b/build/cmake/aom_experiment_deps.cmake
@@ -18,9 +18,7 @@
macro(fix_experiment_configs)
if(CONFIG_ANALYZER)
- if(NOT CONFIG_INSPECTION)
- change_config_and_warn(CONFIG_INSPECTION 1 CONFIG_ANALYZER)
- endif()
+ change_config_and_warn(CONFIG_INSPECTION 1 CONFIG_ANALYZER)
endif()
if(CONFIG_RD_DEBUG)
diff --git a/build/cmake/util.cmake b/build/cmake/util.cmake
index 4aa730a..a0c7056 100644
--- a/build/cmake/util.cmake
+++ b/build/cmake/util.cmake
@@ -36,8 +36,12 @@
# Sets the value of the variable referenced by $feature to $value, and reports
# the change to the user via call to message(WARNING ...). $cause is expected to
-# be a configuration variable that conflicts with $feature in some way.
+# be a configuration variable that conflicts with $feature in some way. This
+# function is a noop if $feature is already set to $value.
function(change_config_and_warn feature value cause)
+ if(${feature} EQUAL ${value})
+ return()
+ endif()
set(${feature} ${value} PARENT_SCOPE)
if(${value} EQUAL 1)
set(verb "Enabled")