diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-12-06 17:38:04 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-12-06 17:38:04 (GMT) |
commit | 2615e6f0a9ce35198d54922aedc1ab5b7f1a68c3 (patch) | |
tree | d69f29f6b80c576c270383404834bd14a27b7a1d | |
parent | e3bb6683dedc2e896689a2b202a5c1ee6e373e18 (diff) | |
download | CMake-2615e6f0a9ce35198d54922aedc1ab5b7f1a68c3.zip CMake-2615e6f0a9ce35198d54922aedc1ab5b7f1a68c3.tar.gz CMake-2615e6f0a9ce35198d54922aedc1ab5b7f1a68c3.tar.bz2 |
BUG: fix for bug 1396, object files could not be used as sources any more
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 16 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 1 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 26 |
3 files changed, 41 insertions, 2 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index beef256..6b02c96 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -330,6 +330,16 @@ const char* cmGlobalGenerator::GetLanguageOutputExtensionFromExtension(const cha return ""; } const char* lang = this->GetLanguageFromExtension(ext); + if(!lang || *lang == 0) + { + // if no language is found then check to see if it is already an + // ouput extension for some language. In that case it should be ignored + // and in this map, so it will not be compiled but will just be used. + if(m_OutputExtensions.count(ext)) + { + return ext; + } + } return this->GetLanguageOutputExtensionForLanguage(lang); } @@ -362,6 +372,11 @@ void cmGlobalGenerator::SetLanguageEnabled(const char* l, cmMakefile* mf) if(outputExtension) { m_LanguageToOutputExtension[l] = outputExtension; + m_OutputExtensions[outputExtension] = outputExtension; + if(outputExtension[0] == '.') + { + m_OutputExtensions[outputExtension+1] = outputExtension+1; + } } std::string linkerPrefVar = std::string("CMAKE_") + @@ -676,6 +691,7 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen ) this->m_IgnoreExtensions = gen->m_IgnoreExtensions; this->m_LanguageToOutputExtension = gen->m_LanguageToOutputExtension; this->m_LanguageToLinkerPreference = gen->m_LanguageToLinkerPreference; + this->m_OutputExtensions = gen->m_OutputExtensions; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 3b04620..89441dc 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -133,6 +133,7 @@ private: // in EnableLanguagesFromGenerator std::map<cmStdString, bool> m_IgnoreExtensions; std::map<cmStdString, bool> m_LanguageEnabled; + std::map<cmStdString, cmStdString> m_OutputExtensions; std::map<cmStdString, cmStdString> m_LanguageToOutputExtension; std::map<cmStdString, cmStdString> m_ExtensionToLanguage; std::map<cmStdString, cmStdString> m_LanguageToLinkerPreference; diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 5b34a48..850f964 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -465,6 +465,7 @@ void cmLocalUnixMakefileGenerator::OutputTargetRules(std::ostream& fout) } } fout << "\n\n"; + std::string outputName; // get the classes from the source lists then add them to the groups for(cmTargets::const_iterator l = tgts.begin(); l != tgts.end(); l++) @@ -524,7 +525,17 @@ void cmLocalUnixMakefileGenerator::OutputTargetRules(std::ostream& fout) { std::string ofname = (*i)->GetSourceName() + outExt; ofname = this->CreateSafeUniqueObjectFileName(ofname.c_str()); - fout << "\\\n\"" << this->ConvertToMakeTarget(ConvertToRelativeOutputPath(ofname.c_str()).c_str()) << "\" "; + outputName = this->ConvertToMakeTarget(ConvertToRelativeOutputPath(ofname.c_str()).c_str()); + fout << "\\\n"; + // if it already is double quoted because of spaces don't do it again. + if(outputName.size() && outputName[0] != '\"') + { + fout << "\"" << outputName << "\" "; + } + else + { + fout << outputName << " "; + } } } } @@ -541,7 +552,18 @@ void cmLocalUnixMakefileGenerator::OutputTargetRules(std::ostream& fout) (*i)->GetSourceExtension().c_str()); if(outExt.size() && (*i)->GetPropertyAsBool("EXTERNAL_OBJECT") ) { - fout << "\\\n\"" << this->ConvertToMakeTarget(ConvertToRelativeOutputPath((*i)->GetFullPath().c_str()).c_str()) << "\" "; + outputName = + this->ConvertToMakeTarget(ConvertToRelativeOutputPath((*i)->GetFullPath().c_str()).c_str()); + fout << "\\\n"; + // if it already is double quoted because of spaces don't do it again. + if(outputName.size() && outputName[0] != '\"') + { + fout << "\"" << outputName << "\" "; + } + else + { + fout << outputName << " "; + } } } } |