diff --git a/Source/EXEHeader.dsptemplate b/Source/EXEHeader.dsptemplate index c2e1f29527..0f6cc82496 100644 --- a/Source/EXEHeader.dsptemplate +++ b/Source/EXEHeader.dsptemplate @@ -63,7 +63,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089 -# ADD LINK32 CM_OPTIMIZED_LIBRARIES CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089 +CM_MULTILINE_OPTIMIZED_LIBRARIES +CM_MULTILINE_LIBRARIES !ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug" @@ -88,7 +90,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089 -# ADD LINK32 CM_DEBUG_LIBRARIES CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089 +CM_MULTILINE_DEBUG_LIBRARIES +CM_MULTILINE_LIBRARIES !ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Release MinSize" # PROP BASE Use_MFC 0 @@ -110,7 +114,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089 -# ADD LINK32 CM_OPTIMIZED_LIBRARIES CM_LIBRARIES kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /IGNORE:4089 +CM_MULTILINE_OPTIMIZED_LIBRARIES +CM_MULTILINE_LIBRARIES !ENDIF diff --git a/Source/cmDSPMakefile.cxx b/Source/cmDSPMakefile.cxx index e1babf3c8e..b2001d3b50 100644 --- a/Source/cmDSPMakefile.cxx +++ b/Source/cmDSPMakefile.cxx @@ -418,6 +418,11 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, std::string libOptions; std::string libDebugOptions; std::string libOptimizedOptions; + + std::string libMultiLineOptions; + std::string libMultiLineDebugOptions; + std::string libMultiLineOptimizedOptions; + std::vector::iterator i; std::vector& libdirs = m_Makefile->GetLinkDirectories(); for(i = libdirs.begin(); i != libdirs.end(); ++i) @@ -428,6 +433,13 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, libOptions += " /LIBPATH:\""; libOptions += *i; libOptions += "\" "; + + libMultiLineOptions += "# ADD LINK32 /LIBPATH:\""; + libMultiLineOptions += *i; + libMultiLineOptions += "/$(OUTDIR)\" "; + libMultiLineOptions += " /LIBPATH:\""; + libMultiLineOptions += *i; + libMultiLineOptions += "\" \n"; } // find link libraries const cmTarget::LinkLibraries& libs = target.GetLinkLibraries(); @@ -449,20 +461,33 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, { libOptions += " "; libOptions += lib; + + libMultiLineOptions += "# ADD LINK32 "; + libMultiLineOptions += lib; + libMultiLineOptions += "\n"; } if (j->second == cmTarget::DEBUG) { libDebugOptions += " "; libDebugOptions += lib; + + libMultiLineDebugOptions += "# ADD LINK32 "; + libMultiLineDebugOptions += lib; + libMultiLineDebugOptions += "\n"; } if (j->second == cmTarget::OPTIMIZED) { libOptimizedOptions += " "; libOptimizedOptions += lib; + + libMultiLineOptimizedOptions += "# ADD LINK32 "; + libMultiLineOptimizedOptions += lib; + libMultiLineOptimizedOptions += "\n"; } } } libOptions += " /STACK:10000000 "; + libMultiLineOptions += "# ADD LINK32 /STACK:10000000 \n"; std::ifstream fin(m_DSPHeaderTemplate.c_str()); if(!fin) @@ -481,6 +506,14 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, libDebugOptions.c_str()); cmSystemTools::ReplaceString(line, "CM_OPTIMIZED_LIBRARIES", libOptimizedOptions.c_str()); + + cmSystemTools::ReplaceString(line, "CM_MULTILINE_LIBRARIES", + libMultiLineOptions.c_str()); + cmSystemTools::ReplaceString(line, "CM_MULTILINE_DEBUG_LIBRARIES", + libMultiLineDebugOptions.c_str()); + cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIMIZED_LIBRARIES", + libMultiLineOptimizedOptions.c_str()); + cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", m_IncludeOptions.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName); diff --git a/Source/cmDSPWriter.cxx b/Source/cmDSPWriter.cxx index e1babf3c8e..b2001d3b50 100644 --- a/Source/cmDSPWriter.cxx +++ b/Source/cmDSPWriter.cxx @@ -418,6 +418,11 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, std::string libOptions; std::string libDebugOptions; std::string libOptimizedOptions; + + std::string libMultiLineOptions; + std::string libMultiLineDebugOptions; + std::string libMultiLineOptimizedOptions; + std::vector::iterator i; std::vector& libdirs = m_Makefile->GetLinkDirectories(); for(i = libdirs.begin(); i != libdirs.end(); ++i) @@ -428,6 +433,13 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, libOptions += " /LIBPATH:\""; libOptions += *i; libOptions += "\" "; + + libMultiLineOptions += "# ADD LINK32 /LIBPATH:\""; + libMultiLineOptions += *i; + libMultiLineOptions += "/$(OUTDIR)\" "; + libMultiLineOptions += " /LIBPATH:\""; + libMultiLineOptions += *i; + libMultiLineOptions += "\" \n"; } // find link libraries const cmTarget::LinkLibraries& libs = target.GetLinkLibraries(); @@ -449,20 +461,33 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, { libOptions += " "; libOptions += lib; + + libMultiLineOptions += "# ADD LINK32 "; + libMultiLineOptions += lib; + libMultiLineOptions += "\n"; } if (j->second == cmTarget::DEBUG) { libDebugOptions += " "; libDebugOptions += lib; + + libMultiLineDebugOptions += "# ADD LINK32 "; + libMultiLineDebugOptions += lib; + libMultiLineDebugOptions += "\n"; } if (j->second == cmTarget::OPTIMIZED) { libOptimizedOptions += " "; libOptimizedOptions += lib; + + libMultiLineOptimizedOptions += "# ADD LINK32 "; + libMultiLineOptimizedOptions += lib; + libMultiLineOptimizedOptions += "\n"; } } } libOptions += " /STACK:10000000 "; + libMultiLineOptions += "# ADD LINK32 /STACK:10000000 \n"; std::ifstream fin(m_DSPHeaderTemplate.c_str()); if(!fin) @@ -481,6 +506,14 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout, const char *libName, libDebugOptions.c_str()); cmSystemTools::ReplaceString(line, "CM_OPTIMIZED_LIBRARIES", libOptimizedOptions.c_str()); + + cmSystemTools::ReplaceString(line, "CM_MULTILINE_LIBRARIES", + libMultiLineOptions.c_str()); + cmSystemTools::ReplaceString(line, "CM_MULTILINE_DEBUG_LIBRARIES", + libMultiLineDebugOptions.c_str()); + cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIMIZED_LIBRARIES", + libMultiLineOptimizedOptions.c_str()); + cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", m_IncludeOptions.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName);