Browse Source

ENH: fix debugging with borland

Bill Hoffman 24 years ago
parent
commit
2bdcc9ae7e

+ 5 - 1
Modules/FindOpenGL.cmake

@@ -7,7 +7,11 @@
 #
 
 IF (WIN32)
-  SET (OPENGL_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
+  IF(BORLAND)
+    SET (OPENGL_LIBRARY import32 CACHE STRING "OpenGL library for win32")
+  ELSE(BORLAND)
+    SET (OPENGL_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
+  ENDIF(BORLAND)
 ELSE (WIN32)
   FIND_PATH(OPENGL_INCLUDE_PATH GL/gl.h 
   /usr/include 

+ 12 - 3
Source/cmBorlandMakefileGenerator.cxx

@@ -88,7 +88,8 @@ void cmBorlandMakefileGenerator::OutputMakeVariables(std::ostream& fout)
     "CMAKE_OBJECT_FILE_SUFFIX            = @CMAKE_OBJECT_FILE_SUFFIX@\n"
     "CMAKE_EXECUTABLE_SUFFIX             = @CMAKE_EXECUTABLE_SUFFIX@\n"
     "CMAKE_STATICLIB_SUFFIX              = @CMAKE_STATICLIB_SUFFIX@\n"
-    "CMAKE_SHLIB_SUFFIX                  = @CMAKE_SHLIB_SUFFIX@\n"
+    "CMAKE_SHLIB_SUFFIX                  = @CMAKE_SHLIB_SUFFIX@\n" 
+    "CMAKE_LINKER_FLAGS                  = @CMAKE_LINKER_FLAGS@ @LINKER_BUILD_FLAGS@\n"
     "CMAKE_CXX_FLAGS      = -P @CMAKE_CXX_FLAGS@ @BUILD_FLAGS@\n";
   std::string buildType = "CMAKE_CXX_FLAGS_";
   buildType +=  m_Makefile->GetDefinition("CMAKE_BUILD_TYPE");
@@ -96,6 +97,14 @@ void cmBorlandMakefileGenerator::OutputMakeVariables(std::ostream& fout)
   m_Makefile->AddDefinition("BUILD_FLAGS",
                             m_Makefile->GetDefinition(
                               buildType.c_str()));
+  
+  buildType = "CMAKE_LINKER_FLAGS_";
+  buildType +=  m_Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+  buildType = cmSystemTools::UpperCase(buildType);
+  m_Makefile->AddDefinition("LINKER_BUILD_FLAGS",
+                            m_Makefile->GetDefinition(
+                              buildType.c_str()));
+
   std::string replaceVars = variables;
   m_Makefile->ExpandVariablesInString(replaceVars);
   
@@ -327,7 +336,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  @&&|\n";
+  std::string command = "$(CMAKE_CXX_COMPILER) -tWD $(CMAKE_LINKER_FLAGS) @&&|\n";
   // must be executable name
   command += "-e";
   command += target;
@@ -409,7 +418,7 @@ void cmBorlandMakefileGenerator::OutputExecutableRule(std::ostream& fout,
   depend += std::string(name) + "_SRC_OBJS) $(" + std::string(name) + "_DEPEND_LIBS)";
   std::string command = 
     "$(CMAKE_CXX_COMPILER) ";
-  command += " -e" + target;
+  command += " $(CMAKE_LINKER_FLAGS) -e" + target;
   if(t.GetType() == cmTarget::WIN32_EXECUTABLE)
     {
     command +=  " -tWM ";

+ 16 - 1
Templates/CMakeBorlandWindowsSystemConfig.cmake

@@ -36,9 +36,24 @@ SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Od" CACHE STRING
 SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O1" CACHE STRING
      "Flags used by the compiler during release minsize builds.")
 
-SET (CMAKE_CXX_FLAGS_DEBUG "-Od" CACHE STRING
+SET (CMAKE_CXX_FLAGS_DEBUG "-Od -v" CACHE STRING
      "Flags used by the compiler during debug builds.")
 
+SET (CMAKE_LINKER_FLAGS "" CACHE STRING
+     "Flags used by the linker.")
+
+SET (CMAKE_LINKER_FLAGS_DEBUG "-v" CACHE STRING
+     "Flags used by the linker during debug builds.")
+
+SET (CMAKE_LINKER_FLAGS_MINSIZEREL "" CACHE STRING
+     "Flags used by the linker during release minsize builds.")
+
+SET (CMAKE_LINKER_FLAGS_RELEASE "" CACHE STRING
+     "Flags used by the linker during release builds.")
+
+SET (CMAKE_LINKER_FLAGS_RELWITHDEBINFO "-v" CACHE STRING
+     "Flags used by the linker during Release with Debug Info builds.")
+
 SET (CMAKE_CXX_FLAGS "-w- -whid -waus -wpar" 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.")