| 958 | } |
| 959 | |
| 960 | void cmLocalVisualStudio7Generator::OutputBuildTool( |
| 961 | std::ostream& fout, std::string const& linkLanguage, |
| 962 | std::string const& configName, cmGeneratorTarget* target, |
| 963 | Options const& targetOptions) |
| 964 | { |
| 965 | cmGlobalVisualStudio7Generator* gg = |
| 966 | static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); |
| 967 | std::string temp; |
| 968 | std::string extraLinkOptions; |
| 969 | this->AddTargetTypeLinkerFlags(extraLinkOptions, target, linkLanguage, |
| 970 | configName); |
| 971 | this->AddPerLanguageLinkFlags(extraLinkOptions, target, linkLanguage, |
| 972 | configName); |
| 973 | |
| 974 | this->AddTargetPropertyLinkFlags(extraLinkOptions, target, configName); |
| 975 | |
| 976 | std::vector<std::string> opts; |
| 977 | target->GetLinkOptions(opts, configName, |
| 978 | target->GetLinkerLanguage(configName)); |
| 979 | // LINK_OPTIONS are escaped. |
| 980 | this->AppendCompileOptions(extraLinkOptions, opts); |
| 981 | |
| 982 | this->AppendWarningAsErrorLinkerFlags(extraLinkOptions, target, |
| 983 | linkLanguage); |
| 984 | |
| 985 | Options linkOptions(this, Options::Linker); |
| 986 | if (this->FortranProject) { |
| 987 | linkOptions.AddTable(cmLocalVisualStudio7GeneratorFortranLinkFlagTable); |
| 988 | } |
| 989 | linkOptions.AddTable(cmLocalVisualStudio7GeneratorLinkFlagTable); |
| 990 | |
| 991 | linkOptions.Parse(extraLinkOptions); |
| 992 | cmGeneratorTarget::ModuleDefinitionInfo const* mdi = |
| 993 | target->GetModuleDefinitionInfo(configName); |
| 994 | if (mdi && !mdi->DefFile.empty()) { |
| 995 | std::string defFile = |
| 996 | this->ConvertToOutputFormat(mdi->DefFile, cmOutputConverter::SHELL); |
| 997 | linkOptions.AddFlag("ModuleDefinitionFile", defFile); |
| 998 | } |
| 999 | |
| 1000 | switch (target->GetType()) { |
| 1001 | case cmStateEnums::UNKNOWN_LIBRARY: |
| 1002 | break; |
| 1003 | case cmStateEnums::OBJECT_LIBRARY: { |
| 1004 | std::string libpath = this->MaybeRelativeToCurBinDir( |
| 1005 | cmStrCat(target->GetSupportDirectory(), '/', configName, '/', |
| 1006 | target->GetName(), ".lib")); |
| 1007 | char const* tool = |
| 1008 | this->FortranProject ? "VFLibrarianTool" : "VCLibrarianTool"; |
| 1009 | fout << "\t\t\t<Tool\n" |
| 1010 | "\t\t\t\tName=\"" |
| 1011 | << tool |
| 1012 | << "\"\n" |
| 1013 | "\t\t\t\tOutputFile=\"" |
| 1014 | << this->ConvertToXMLOutputPathSingle(libpath) << "\"/>\n"; |
| 1015 | break; |
| 1016 | } |
| 1017 | case cmStateEnums::STATIC_LIBRARY: { |
no test coverage detected