ENH: Finished Simplifying dsptemplate processing with in place of separate Release, Debug, ReleaseDLL, ... configurations.

This commit is contained in:
Brad King 2001-03-09 16:56:38 -05:00
parent 772b1f6278
commit 8fb07209eb
7 changed files with 37 additions and 81 deletions

View File

@ -68,7 +68,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe 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 /nologo /dll /machine:I386 # 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 /nologo /dll /machine:I386
# ADD LINK32 CM_RELEASEDLL_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 /nologo /dll /machine:I386 # ADD LINK32 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 /nologo /dll /machine:I386
!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug" !ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug"
@ -95,9 +95,9 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe 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 /nologo /dll /debug /machine:I386 /pdbtype:sept # 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 /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 CM_DEBUGDLL_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 /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 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 /nologo /dll /debug /machine:I386 /pdbtype:sept
!ENDIF !ENDIF
# Begin Target # Begin Target

View File

@ -13,8 +13,7 @@
# BUILD_INCLUDES == include path # BUILD_INCLUDES == include path
# EXTRA_DEFINES == compiler defines # EXTRA_DEFINES == compiler defines
# OUTPUT_LIBNAME == name of output library # OUTPUT_LIBNAME == name of output library
# CM_DEBUG_LIBRARIES == libraries linked in # CM_LIBRARIES == libraries linked in
# CM_RELEASE_LIBRARIES == libraries linked in
# TARGTYPE "Win32 (x86) Application" 0x0101 # TARGTYPE "Win32 (x86) Application" 0x0101
CFG=OUTPUT_LIBNAME - Win32 Debug CFG=OUTPUT_LIBNAME - Win32 Debug
@ -64,7 +63,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe 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 /force # 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 /force
# ADD LINK32 CM_RELEASE_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 /force # ADD LINK32 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 /force
!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug" !ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug"
@ -89,7 +88,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe 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 /force # 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 /force
# ADD LINK32 CM_DEBUG_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 /force # ADD LINK32 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 /force
!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Release MinSize" !ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Release MinSize"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
@ -111,7 +110,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe 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 /force # 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 /force
# ADD LINK32 CM_RELEASE_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 /force # ADD LINK32 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 /force
!ENDIF !ENDIF

View File

@ -54,36 +54,25 @@ void cmDSPMakefile::OutputDSPFile()
std::vector<std::string>& libs = m_Makefile->GetLinkLibraries(); std::vector<std::string>& libs = m_Makefile->GetLinkLibraries();
for(i = libs.begin(); i != libs.end(); ++i) for(i = libs.begin(); i != libs.end(); ++i)
{ {
m_DebugLibraryOptions += " "; m_LibraryOptions += " ";
m_DebugLibraryOptions += *i; m_LibraryOptions += *i;
m_DebugLibraryOptions += ".lib "; m_LibraryOptions += ".lib ";
} }
std::vector<std::string>& libswin32 = m_Makefile->GetLinkLibrariesWin32(); std::vector<std::string>& libswin32 = m_Makefile->GetLinkLibrariesWin32();
for(i = libswin32.begin(); i != libswin32.end(); ++i) for(i = libswin32.begin(); i != libswin32.end(); ++i)
{ {
m_DebugLibraryOptions += " "; m_LibraryOptions += " ";
m_DebugLibraryOptions += *i; m_LibraryOptions += *i;
m_DebugLibraryOptions += ".lib "; m_LibraryOptions += ".lib ";
} }
std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories(); std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories();
for(i = libdirs.begin(); i != libdirs.end(); ++i) for(i = libdirs.begin(); i != libdirs.end(); ++i)
{ {
m_DebugLibraryOptions += " /LIBPATH:\""; m_LibraryOptions += " /LIBPATH:\"";
m_DebugLibraryOptions += *i; m_LibraryOptions += *i;
if(i->find("Debug") == std::string::npos) m_LibraryOptions += "/$(OUTDIR)\" ";
{
if(i->find("Release") == std::string::npos)
{
m_DebugLibraryOptions += "/$(OUTDIR)\" ";
}
}
} }
m_DebugLibraryOptions += "/STACK:10000000 "; m_LibraryOptions += "/STACK:10000000 ";
// add any extra define flags
m_ReleaseLibraryOptions = m_DebugLibraryOptions;
m_DebugDLLLibraryOptions = m_DebugLibraryOptions;
m_ReleaseDLLLibraryOptions = m_DebugDLLLibraryOptions;
m_ReleaseMinSizeLibraryOptions = m_ReleaseLibraryOptions;
// Create the DSP or set of DSP's for libraries and executables // Create the DSP or set of DSP's for libraries and executables
if(strlen(m_Makefile->GetLibraryName()) != 0) if(strlen(m_Makefile->GetLibraryName()) != 0)
@ -317,16 +306,8 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout)
{ {
fin.getline(buffer, 2048); fin.getline(buffer, 2048);
std::string line = buffer; std::string line = buffer;
cmSystemTools::ReplaceString(line, "CM_RELEASE_LIBRARIES", cmSystemTools::ReplaceString(line, "CM_LIBRARIES",
m_ReleaseLibraryOptions.c_str()); m_LibraryOptions.c_str());
cmSystemTools::ReplaceString(line, "CM_RELEASEMINSIZE_LIBRARIES",
m_ReleaseMinSizeLibraryOptions.c_str());
cmSystemTools::ReplaceString(line, "CM_DEBUG_LIBRARIES",
m_DebugLibraryOptions.c_str());
cmSystemTools::ReplaceString(line, "CM_RELEASEDLL_LIBRARIES",
m_ReleaseDLLLibraryOptions.c_str());
cmSystemTools::ReplaceString(line, "CM_DEBUGDLL_LIBRARIES",
m_DebugDLLLibraryOptions.c_str());
cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
m_IncludeOptions.c_str()); m_IncludeOptions.c_str());
cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME", cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",
@ -418,3 +399,5 @@ void cmDSPMakefile::WriteDSPBuildRule(std::ostream& fout, const char* path)
<< path << "\n"; << path << "\n";
fout << "# End Source File\n"; fout << "# End Source File\n";
} }

View File

@ -86,11 +86,7 @@ private:
std::vector<std::string>& depends); std::vector<std::string>& depends);
std::string m_IncludeOptions; std::string m_IncludeOptions;
std::string m_DebugLibraryOptions; std::string m_LibraryOptions;
std::string m_ReleaseLibraryOptions;
std::string m_ReleaseMinSizeLibraryOptions;
std::string m_DebugDLLLibraryOptions;
std::string m_ReleaseDLLLibraryOptions;
cmMakefile* m_Makefile; cmMakefile* m_Makefile;
BuildType m_BuildType; BuildType m_BuildType;
std::vector<std::string> m_Configurations; std::vector<std::string> m_Configurations;

View File

@ -54,36 +54,25 @@ void cmDSPMakefile::OutputDSPFile()
std::vector<std::string>& libs = m_Makefile->GetLinkLibraries(); std::vector<std::string>& libs = m_Makefile->GetLinkLibraries();
for(i = libs.begin(); i != libs.end(); ++i) for(i = libs.begin(); i != libs.end(); ++i)
{ {
m_DebugLibraryOptions += " "; m_LibraryOptions += " ";
m_DebugLibraryOptions += *i; m_LibraryOptions += *i;
m_DebugLibraryOptions += ".lib "; m_LibraryOptions += ".lib ";
} }
std::vector<std::string>& libswin32 = m_Makefile->GetLinkLibrariesWin32(); std::vector<std::string>& libswin32 = m_Makefile->GetLinkLibrariesWin32();
for(i = libswin32.begin(); i != libswin32.end(); ++i) for(i = libswin32.begin(); i != libswin32.end(); ++i)
{ {
m_DebugLibraryOptions += " "; m_LibraryOptions += " ";
m_DebugLibraryOptions += *i; m_LibraryOptions += *i;
m_DebugLibraryOptions += ".lib "; m_LibraryOptions += ".lib ";
} }
std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories(); std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories();
for(i = libdirs.begin(); i != libdirs.end(); ++i) for(i = libdirs.begin(); i != libdirs.end(); ++i)
{ {
m_DebugLibraryOptions += " /LIBPATH:\""; m_LibraryOptions += " /LIBPATH:\"";
m_DebugLibraryOptions += *i; m_LibraryOptions += *i;
if(i->find("Debug") == std::string::npos) m_LibraryOptions += "/$(OUTDIR)\" ";
{
if(i->find("Release") == std::string::npos)
{
m_DebugLibraryOptions += "/$(OUTDIR)\" ";
}
}
} }
m_DebugLibraryOptions += "/STACK:10000000 "; m_LibraryOptions += "/STACK:10000000 ";
// add any extra define flags
m_ReleaseLibraryOptions = m_DebugLibraryOptions;
m_DebugDLLLibraryOptions = m_DebugLibraryOptions;
m_ReleaseDLLLibraryOptions = m_DebugDLLLibraryOptions;
m_ReleaseMinSizeLibraryOptions = m_ReleaseLibraryOptions;
// Create the DSP or set of DSP's for libraries and executables // Create the DSP or set of DSP's for libraries and executables
if(strlen(m_Makefile->GetLibraryName()) != 0) if(strlen(m_Makefile->GetLibraryName()) != 0)
@ -317,16 +306,8 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout)
{ {
fin.getline(buffer, 2048); fin.getline(buffer, 2048);
std::string line = buffer; std::string line = buffer;
cmSystemTools::ReplaceString(line, "CM_RELEASE_LIBRARIES", cmSystemTools::ReplaceString(line, "CM_LIBRARIES",
m_ReleaseLibraryOptions.c_str()); m_LibraryOptions.c_str());
cmSystemTools::ReplaceString(line, "CM_RELEASEMINSIZE_LIBRARIES",
m_ReleaseMinSizeLibraryOptions.c_str());
cmSystemTools::ReplaceString(line, "CM_DEBUG_LIBRARIES",
m_DebugLibraryOptions.c_str());
cmSystemTools::ReplaceString(line, "CM_RELEASEDLL_LIBRARIES",
m_ReleaseDLLLibraryOptions.c_str());
cmSystemTools::ReplaceString(line, "CM_DEBUGDLL_LIBRARIES",
m_DebugDLLLibraryOptions.c_str());
cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
m_IncludeOptions.c_str()); m_IncludeOptions.c_str());
cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME", cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",
@ -418,3 +399,5 @@ void cmDSPMakefile::WriteDSPBuildRule(std::ostream& fout, const char* path)
<< path << "\n"; << path << "\n";
fout << "# End Source File\n"; fout << "# End Source File\n";
} }

View File

@ -86,11 +86,7 @@ private:
std::vector<std::string>& depends); std::vector<std::string>& depends);
std::string m_IncludeOptions; std::string m_IncludeOptions;
std::string m_DebugLibraryOptions; std::string m_LibraryOptions;
std::string m_ReleaseLibraryOptions;
std::string m_ReleaseMinSizeLibraryOptions;
std::string m_DebugDLLLibraryOptions;
std::string m_ReleaseDLLLibraryOptions;
cmMakefile* m_Makefile; cmMakefile* m_Makefile;
BuildType m_BuildType; BuildType m_BuildType;
std::vector<std::string> m_Configurations; std::vector<std::string> m_Configurations;

View File

@ -31,7 +31,6 @@ CFG=OUTPUT_LIBNAME - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE "OUTPUT_LIBNAME - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "OUTPUT_LIBNAME - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "OUTPUT_LIBNAME - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "OUTPUT_LIBNAME - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
!MESSAGE "OUTPUT_LIBNAME - Win32 Release MinSize" (based on "Win32 (x86) Static Library") !MESSAGE "OUTPUT_LIBNAME - Win32 Release MinSize" (based on "Win32 (x86) Static Library")
# Begin Project # Begin Project
# PROP AllowPerConfigDependencies 0 # PROP AllowPerConfigDependencies 0