From 6dc78a2315d5538d562b0270276c88c0fdcb147b Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 8 Jan 2002 13:33:00 -0500 Subject: [PATCH] ENH: add CMAKE_EXTRA_LINK_FLAGS to dsp generator --- Source/cmDSPWriter.cxx | 11 +++++++++-- Templates/CMakeWindowsSystemConfig.cmake | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Source/cmDSPWriter.cxx b/Source/cmDSPWriter.cxx index c3ad622e8..d981e428e 100644 --- a/Source/cmDSPWriter.cxx +++ b/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 diff --git a/Templates/CMakeWindowsSystemConfig.cmake b/Templates/CMakeWindowsSystemConfig.cmake index ec093dd2c..07e0c88b0 100644 --- a/Templates/CMakeWindowsSystemConfig.cmake +++ b/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 )