diff options
author | Brad King <brad.king@kitware.com> | 2001-06-27 19:13:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-06-27 19:13:26 (GMT) |
commit | 7bb9fdbeef33aec26e3b7b36e8a216b393a50a4b (patch) | |
tree | d61cfdc8f4ea43d287038201e851f391ca0339e0 | |
parent | 459dfc753174bfb91c794addb62707b3216914cd (diff) | |
download | CMake-7bb9fdbeef33aec26e3b7b36e8a216b393a50a4b.zip CMake-7bb9fdbeef33aec26e3b7b36e8a216b393a50a4b.tar.gz CMake-7bb9fdbeef33aec26e3b7b36e8a216b393a50a4b.tar.bz2 |
BUG: Check for building shared libraries should read from the make file's setting, not directly from the cache.
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 23 | ||||
-rw-r--r-- | Source/cmUnixMakefileGenerator.h | 1 |
2 files changed, 15 insertions, 9 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index 476dc34..edabe4e 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -239,6 +239,12 @@ void cmUnixMakefileGenerator::OutputMakefile(const char* file) } +bool cmUnixMakefileGenerator::BuildingSharedLibs() const +{ + return !cmSystemTools::IsOff(m_Makefile->GetDefinition("BUILD_SHARED_LIBS")); +} + + // Output the rules for any targets void cmUnixMakefileGenerator::OutputTargetRules(std::ostream& fout) { @@ -246,7 +252,7 @@ void cmUnixMakefileGenerator::OutputTargetRules(std::ostream& fout) fout << "TARGETS = "; const cmTargets &tgts = m_Makefile->GetTargets(); // list libraries first - bool dll = cmCacheManager::GetInstance()->IsOn("BUILD_SHARED_LIBS"); + bool dll = this->BuildingSharedLibs(); for(cmTargets::const_iterator l = tgts.begin(); l != tgts.end(); l++) { @@ -332,7 +338,7 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout, std::set<std::string> emitted; // Embed runtime search paths if possible and if required. - bool outputRuntime = cmCacheManager::GetInstance()->IsOn("BUILD_SHARED_LIBS"); + bool outputRuntime = this->BuildingSharedLibs(); std::string runtimeFlag; std::string runtimeSep; std::vector<std::string> runtimeDirs; @@ -478,9 +484,8 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout, void cmUnixMakefileGenerator::OutputTargets(std::ostream& fout) { - - bool dll = cmCacheManager::GetInstance()->IsOn("BUILD_SHARED_LIBS"); - + bool dll = this->BuildingSharedLibs(); + // for each target const cmTargets &tgts = m_Makefile->GetTargets(); for(cmTargets::const_iterator l = tgts.begin(); @@ -562,7 +567,7 @@ void cmUnixMakefileGenerator::OutputDependencies(std::ostream& fout) libpath += "/lib"; } libpath += lib2->first; - bool dll = cmCacheManager::GetInstance()->IsOn("BUILD_SHARED_LIBS"); + bool dll = this->BuildingSharedLibs(); if(dll) { libpath += m_Makefile->GetDefinition("CMAKE_SHLIB_SUFFIX"); @@ -593,7 +598,7 @@ void cmUnixMakefileGenerator::OutputDependencies(std::ostream& fout) { std::string library = "lib"; library += lib2->first; - bool dll = cmCacheManager::GetInstance()->IsOn("BUILD_SHARED_LIBS"); + bool dll = this->BuildingSharedLibs(); if(dll) { library += m_Makefile->GetDefinition("CMAKE_SHLIB_SUFFIX"); @@ -947,7 +952,7 @@ void cmUnixMakefileGenerator::OutputMakeVariables(std::ostream& fout) "\n" "\n"; std::string replaceVars = variables; - bool dll = cmCacheManager::GetInstance()->IsOn("BUILD_SHARED_LIBS"); + bool dll = this->BuildingSharedLibs(); if(!dll) { // if not a dll then remove the shlib -fpic flag @@ -963,7 +968,7 @@ void cmUnixMakefileGenerator::OutputMakeVariables(std::ostream& fout) void cmUnixMakefileGenerator::OutputInstallRules(std::ostream& fout) { - bool dll = cmCacheManager::GetInstance()->IsOn("BUILD_SHARED_LIBS"); + bool dll = this->BuildingSharedLibs(); const char* root = cmCacheManager::GetInstance()->GetCacheValue("CMAKE_ROOT"); fout << "INSTALL = " << root << "/Templates/install-sh -c\n"; diff --git a/Source/cmUnixMakefileGenerator.h b/Source/cmUnixMakefileGenerator.h index 82230bc..ed0fd07 100644 --- a/Source/cmUnixMakefileGenerator.h +++ b/Source/cmUnixMakefileGenerator.h @@ -94,6 +94,7 @@ private: void RecursiveGenerateCacheOnly(); void ProcessDepends(const cmMakeDepend &md); void GenerateCacheOnly(); + bool BuildingSharedLibs() const; void OutputMakefile(const char* file); void OutputMakeFlags(std::ostream&); void OutputTargetRules(std::ostream& fout); |