diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-12-03 22:01:40 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-12-03 22:01:40 (GMT) |
commit | 2bdcc9ae7e98c840c53d63d7b5fb5d6b66650225 (patch) | |
tree | 156d6cdcd46d3c027646ccb0618efa7178af5d5a | |
parent | b545988c0b33cefccbc78bdaa97fe268a5176754 (diff) | |
download | CMake-2bdcc9ae7e98c840c53d63d7b5fb5d6b66650225.zip CMake-2bdcc9ae7e98c840c53d63d7b5fb5d6b66650225.tar.gz CMake-2bdcc9ae7e98c840c53d63d7b5fb5d6b66650225.tar.bz2 |
ENH: fix debugging with borland
-rw-r--r-- | Modules/FindOpenGL.cmake | 6 | ||||
-rw-r--r-- | Source/cmBorlandMakefileGenerator.cxx | 15 | ||||
-rw-r--r-- | Templates/CMakeBorlandWindowsSystemConfig.cmake | 17 |
3 files changed, 33 insertions, 5 deletions
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index ce0f14a..4276512 100644 --- a/Modules/FindOpenGL.cmake +++ b/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 diff --git a/Source/cmBorlandMakefileGenerator.cxx b/Source/cmBorlandMakefileGenerator.cxx index 91fc6d5..d5c8f4e 100644 --- a/Source/cmBorlandMakefileGenerator.cxx +++ b/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 "; diff --git a/Templates/CMakeBorlandWindowsSystemConfig.cmake b/Templates/CMakeBorlandWindowsSystemConfig.cmake index c83ce7f..609379a 100644 --- a/Templates/CMakeBorlandWindowsSystemConfig.cmake +++ b/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.") |