From d0397266d2883a98133d0e72c8e1c510ffc4f73d Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Sat, 12 Jan 2002 22:55:35 -0500 Subject: BUG: use borland run time dll for shared builds to avoid crashes --- Source/cmBorlandMakefileGenerator.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 "; -- cgit v0.12