Browse Source

ENH: add CMAKE_EXTRA_LINK_FLAGS to dsp generator

Bill Hoffman 24 years ago
parent
commit
6dc78a2315
2 changed files with 13 additions and 2 deletions
  1. 9 2
      Source/cmDSPWriter.cxx
  2. 4 0
      Templates/CMakeWindowsSystemConfig.cmake

+ 9 - 2
Source/cmDSPWriter.cxx

@@ -653,8 +653,15 @@ void cmDSPWriter::WriteDSPHeader(std::ostream& fout, const char *libName,
         }      
       }
     }
-  libOptions += " /STACK:10000000 ";
-  libMultiLineOptions += "# ADD LINK32 /STACK:10000000 \n";
+  std::string extraLinkOptions = 
+    m_Makefile->GetDefinition("CMAKE_EXTRA_LINK_FLAGS");
+  if(extraLinkOptions.size())
+    {
+    libOptions += extraLinkOptions;
+    libMultiLineOptions += "# ADD LINK32 ";
+    libMultiLineOptions +=  extraLinkOptions;
+    libMultiLineOptions += " \n";
+    }
   
   // are there any custom rules on the target itself
   // only if the target is a lib or exe

+ 4 - 0
Templates/CMakeWindowsSystemConfig.cmake

@@ -19,6 +19,9 @@ SET (CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Od /GZ" CACHE STRING
 SET (CMAKE_CXX_FLAGS "/W3 /Zm1000 /GX /GR" CACHE STRING
      "Flags used by the compiler during all build types, /GX /GR are for exceptions and rtti in VC++, /Zm1000 increases the compiler's memory allocation to support ANSI C++/stdlib")
 
+SET (CMAKE_EXTRA_LINK_FLAGS "/STACK:10000000" CACHE STRING
+     "Extra flags added to the link line for creation of exe and dlls.")
+
 SET (CMAKE_USE_WIN32_THREADS 1 CACHE BOOL 
      "Use the win32 thread library")
 
@@ -47,6 +50,7 @@ CMAKE_CXX_FLAGS_MINSIZEREL
 CMAKE_CXX_FLAGS_DEBUG
 CMAKE_USE_WIN32_THREADS
 CMAKE_MAKE_PROGRAM
+CMAKE_EXTRA_LINK_FLAGS
 )