summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-10-08 18:56:15 (GMT)
committerBrad King <brad.king@kitware.com>2009-10-08 18:56:15 (GMT)
commit9a77f65da7d3275760a60d0a6180a9c240ba30e5 (patch)
tree7326f55451af5e372483a512caaa44906a67570a /Source/cmMakefile.cxx
parent24bf97440fc8730860620c65d9dfd487ca68c69d (diff)
downloadCMake-9a77f65da7d3275760a60d0a6180a9c240ba30e5.zip
CMake-9a77f65da7d3275760a60d0a6180a9c240ba30e5.tar.gz
CMake-9a77f65da7d3275760a60d0a6180a9c240ba30e5.tar.bz2
Remove CMake Policy CMP0015 until it is revised
We revert commit "Create CMake Policy CMP0015 to fix set(CACHE)" because the NEW behavior of the policy breaks a valid use case: # CMakeLists.txt option(BUILD_SHARED_LIBS "..." ON) add_library(mylib ...) set(BUILD_SHARED_LIBS OFF) # we want only mylib to be shared add_subdirectory(ThirdParty) # ThirdParty/CMakeLists.txt option(BUILD_SHARED_LIBS "..." ON) # uh, oh, with NEW behavior this dir uses shared libs!!! We'll re-introduce the policy later with a different change in behavior to resolve the motivating case, which was more subtle but less common. See issue #9008.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx51
1 files changed, 0 insertions, 51 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6fc0dd4..88c8c7b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1642,57 +1642,6 @@ void cmMakefile::AddDefinition(const char* name, const char* value)
#endif
}
-//----------------------------------------------------------------------------
-void cmMakefile::UseCacheDefinition(cmCacheManager::CacheIterator const& it)
-{
- // Check for a local definition that might hide the cache value.
- const char* name = it.GetName();
- const char* def = this->Internal->VarStack.top().Get(name);
- if(!def)
- {
- return;
- }
-
- // If the visible value will change then check policy CMP0015.
- const char* cache = it.GetValue();
- if(strcmp(def, cache) != 0)
- {
- cmOStringStream e;
- switch (this->GetPolicyStatus(cmPolicies::CMP0015))
- {
- case cmPolicies::WARN:
- e << "Local variable \"" << name << "\" is set to\n"
- << " " << def << "\n"
- << "but the CACHE entry of the same name is set to\n"
- << " " << cache << "\n"
- << "The local variable is hiding the cache value."
- << "\n"
- << this->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0015);
- this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- case cmPolicies::OLD:
- // OLD behavior is to leave local definition.
- return;
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::REQUIRED_ALWAYS:
- e << "Local variable \"" << name << "\" is set to\n"
- << " " << def << "\n"
- << "but the CACHE entry of the same name is set to\n"
- << " " << cache << "\n"
- << "This command is removing the local variable to expose "
- << "the cache value."
- << "\n"
- << this->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP0015);
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
- case cmPolicies::NEW:
- // NEW behavior is to remove local definition (done below).
- break;
- }
- }
-
- // Remove the local definition to make the cache value visible.
- this->RemoveDefinition(name);
-}
-
void cmMakefile::AddCacheDefinition(const char* name, const char* value,
const char* doc,