summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-01-13 03:55:35 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-01-13 03:55:35 (GMT)
commitd0397266d2883a98133d0e72c8e1c510ffc4f73d (patch)
tree2c282a04501060b13da878932696331269faeca8 /Source
parent3d5d5fa06db3f4eb04ca2a33744658f06cad6893 (diff)
downloadCMake-d0397266d2883a98133d0e72c8e1c510ffc4f73d.zip
CMake-d0397266d2883a98133d0e72c8e1c510ffc4f73d.tar.gz
CMake-d0397266d2883a98133d0e72c8e1c510ffc4f73d.tar.bz2
BUG: use borland run time dll for shared builds to avoid crashes
Diffstat (limited to 'Source')
-rw-r--r--Source/cmBorlandMakefileGenerator.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmBorlandMakefileGenerator.cxx b/Source/cmBorlandMakefileGenerator.cxx
index abb33b5..2d37cce 100644
--- a/Source/cmBorlandMakefileGenerator.cxx
+++ b/Source/cmBorlandMakefileGenerator.cxx
@@ -98,6 +98,7 @@ void cmBorlandMakefileGenerator::OutputMakeVariables(std::ostream& fout)
"CMAKE_EXECUTABLE_SUFFIX = @CMAKE_EXECUTABLE_SUFFIX@\n"
"CMAKE_STATICLIB_SUFFIX = @CMAKE_STATICLIB_SUFFIX@\n"
"CMAKE_SHLIB_SUFFIX = @CMAKE_SHLIB_SUFFIX@\n"
+ "CMAKE_SHLIB_CFLAGS = -tWR\n"
"CMAKE_LINKER_FLAGS = @CMAKE_LINKER_FLAGS@ @LINKER_BUILD_FLAGS@\n"
"CMAKE_CXX_FLAGS = -P @CMAKE_CXX_FLAGS@ @BUILD_FLAGS@\n"
"!IF \"$(OS)\" == \"Windows_NT\"\n"
@@ -179,6 +180,11 @@ OutputBuildObjectFromSource(std::ostream& fout,
const char* extraCompileFlags,
bool shared)
{
+ // force shared flag if building shared libraries
+ if(cmSystemTools::IsOn(m_Makefile->GetDefinition("BUILD_SHARED_LIBS")))
+ {
+ shared = true;
+ }
// Header files shouldn't have build rules.
if(source.IsAHeaderFileOnly())
return;
@@ -255,7 +261,7 @@ void cmBorlandMakefileGenerator::OutputSharedLibraryRule(std::ostream& fout,
std::string depend = "$(";
depend += name;
depend += "_SRC_OBJS) $(" + std::string(name) + "_DEPEND_LIBS)";
- std::string command = "$(CMAKE_CXX_COMPILER) -tWD $(CMAKE_LINKER_FLAGS) @&&|\n";
+ std::string command = "$(CMAKE_CXX_COMPILER) -tWD $(CMAKE_SHLIB_CFLAGS) $(CMAKE_LINKER_FLAGS) @&&|\n";
// must be executable name
command += "-e";
command += target;
@@ -351,6 +357,10 @@ void cmBorlandMakefileGenerator::OutputExecutableRule(std::ostream& fout,
std::string command =
"$(CMAKE_CXX_COMPILER) ";
command += " $(CMAKE_LINKER_FLAGS) -e" + target;
+ if(cmSystemTools::IsOn(m_Makefile->GetDefinition("BUILD_SHARED_LIBS")))
+ {
+ command += " $(CMAKE_SHLIB_CFLAGS) ";
+ }
if(t.GetType() == cmTarget::WIN32_EXECUTABLE)
{
command += " -tWM ";