浏览代码

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

Brad King 24 年之前
父节点
当前提交
8fb07209eb

+ 3 - 3
Source/DLLHeader.dsptemplate

@@ -68,7 +68,7 @@ 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 /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"
 
@@ -95,9 +95,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 /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
 

+ 4 - 5
Source/EXEHeader.dsptemplate

@@ -13,8 +13,7 @@
 # BUILD_INCLUDES == include path
 # EXTRA_DEFINES == compiler defines
 # OUTPUT_LIBNAME  == name of output library
-# CM_DEBUG_LIBRARIES == libraries linked in 
-# CM_RELEASE_LIBRARIES == libraries linked in 
+# CM_LIBRARIES == libraries linked in 
 # TARGTYPE "Win32 (x86) Application" 0x0101
 
 CFG=OUTPUT_LIBNAME - Win32 Debug
@@ -64,7 +63,7 @@ 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 /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"
 
@@ -89,7 +88,7 @@ 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 /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"
 # PROP BASE Use_MFC 0
@@ -111,7 +110,7 @@ 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 /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 
 

+ 14 - 31
Source/cmDSPMakefile.cxx

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

+ 1 - 5
Source/cmDSPMakefile.h

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

+ 14 - 31
Source/cmDSPWriter.cxx

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

+ 1 - 5
Source/cmDSPWriter.h

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

+ 0 - 1
Source/staticLibHeader.dsptemplate

@@ -31,7 +31,6 @@ CFG=OUTPUT_LIBNAME - Win32 Debug
 !MESSAGE 
 !MESSAGE "OUTPUT_LIBNAME - Win32 Release" (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")
 # Begin Project
 # PROP AllowPerConfigDependencies 0