diff options
author | Brad King <brad.king@kitware.com> | 2006-04-11 20:55:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-04-11 20:55:49 (GMT) |
commit | 08289893b8590be41d0541af7644e737035aee54 (patch) | |
tree | 8ad52af77e4837c0f7fd936b6c52ca083f66c0c0 /Source/cmLocalVisualStudio7Generator.cxx | |
parent | e380bad5f6fbe37048e3f06e125e2938da9ffc68 (diff) | |
download | CMake-08289893b8590be41d0541af7644e737035aee54.zip CMake-08289893b8590be41d0541af7644e737035aee54.tar.gz CMake-08289893b8590be41d0541af7644e737035aee54.tar.bz2 |
ENH: Split CMAKE_STANDARD_LIBRARIES into per-language variables CMAKE_<lang>_STANDARD_LIBRARIES. This is needed to get programmable language support working with Visual Studio generators. It makes sense anyway.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index c619660..dd47fa2 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -667,6 +667,21 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, std::vector<cmStdString> linkDirs; this->ComputeLinkInformation(target, configName, linkLibs, linkDirs); + // Get the language to use for linking. + const char* linkLanguage = target.GetLinkerLanguage(this->GetGlobalGenerator()); + if(!linkLanguage) + { + cmSystemTools::Error("CMake can not determine linker language for target:", + target.GetName()); + return; + } + + // Compute the variable name to lookup standard libraries for this + // language. + std::string standardLibsVar = "CMAKE_"; + standardLibsVar += linkLanguage; + standardLibsVar += "_STANDARD_LIBRARIES"; + fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"VCLinkerTool\"\n" << "\t\t\t\tAdditionalOptions=\"/MACHINE:I386"; @@ -679,7 +694,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, // libraries which may be set by the user to something bad. fout << "\"\n" << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " - << this->Makefile->GetRequiredDefinition("CMAKE_STANDARD_LIBRARIES") + << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) << " "; this->OutputLibraries(fout, linkLibs); fout << "\"\n"; @@ -709,13 +724,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, { fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n"; } - const char* linkLanguage = target.GetLinkerLanguage(this->GetGlobalGenerator()); - if(!linkLanguage) - { - cmSystemTools::Error("CMake can not determine linker language for target:", - target.GetName()); - return; - } std::string stackVar = "CMAKE_"; stackVar += linkLanguage; stackVar += "_STACK_SIZE"; @@ -739,6 +747,21 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, std::vector<cmStdString> linkDirs; this->ComputeLinkInformation(target, configName, linkLibs, linkDirs); + // Get the language to use for linking. + const char* linkLanguage = target.GetLinkerLanguage(this->GetGlobalGenerator()); + if(!linkLanguage) + { + cmSystemTools::Error("CMake can not determine linker language for target:", + target.GetName()); + return; + } + + // Compute the variable name to lookup standard libraries for this + // language. + std::string standardLibsVar = "CMAKE_"; + standardLibsVar += linkLanguage; + standardLibsVar += "_STANDARD_LIBRARIES"; + fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"VCLinkerTool\"\n" << "\t\t\t\tAdditionalOptions=\"/MACHINE:I386"; @@ -751,7 +774,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, // libraries which may be set by the user to something bad. fout << "\"\n" << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " - << this->Makefile->GetRequiredDefinition("CMAKE_STANDARD_LIBRARIES") + << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) << " "; this->OutputLibraries(fout, linkLibs); fout << "\"\n"; @@ -783,13 +806,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, { fout << "\t\t\t\tSubSystem=\"1\"\n"; } - const char* linkLanguage = target.GetLinkerLanguage(this->GetGlobalGenerator()); - if(!linkLanguage) - { - cmSystemTools::Error("CMake can not determine linker language for target:", - target.GetName()); - return; - } std::string stackVar = "CMAKE_"; stackVar += linkLanguage; stackVar += "_STACK_SIZE"; |