diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-11-15 22:45:03 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-11-15 22:45:03 (GMT) |
commit | dad83f4d3c0741e6ea9b2deafe839c4dfefdaff3 (patch) | |
tree | 46e21c96fc22efcd67ea550ea5e245ef832f8858 | |
parent | c164ba1ba157f82a05f18a5c03df653840be590e (diff) | |
download | CMake-dad83f4d3c0741e6ea9b2deafe839c4dfefdaff3.zip CMake-dad83f4d3c0741e6ea9b2deafe839c4dfefdaff3.tar.gz CMake-dad83f4d3c0741e6ea9b2deafe839c4dfefdaff3.tar.bz2 |
BUG: fix for borland run time dll
-rw-r--r-- | Modules/Platform/Windows-bcc32.cmake | 15 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 7 |
2 files changed, 20 insertions, 2 deletions
diff --git a/Modules/Platform/Windows-bcc32.cmake b/Modules/Platform/Windows-bcc32.cmake index a26026e..a6e4843 100644 --- a/Modules/Platform/Windows-bcc32.cmake +++ b/Modules/Platform/Windows-bcc32.cmake @@ -1,6 +1,19 @@ +# Borland shared library issues: +# When building dll's with borland, the run time dll c/c++ library from +# borland must be used. This is specified with the -tWR compiler option. +# This flag must be present during compilation of c and c++ files and +# for the linking of exe and dll files. But wait, there is more, +# the -tWR flag must come after the -tWD and -tWM flags, but before the -tWC flag. +# Order counts, so be careful! +# if building static, you don't want the -tWR flag as it will make your program +# depend on the borland run time dll. +# So, if a project has CMAKE_BUILD_SHARED on, then the -tWR flag is added all over, and +# it is left out if not. + SET(CMAKE_LIBRARY_PATH_FLAG "-L") SET(CMAKE_LINK_LIBRARY_FLAG "") SET(CMAKE_SHARED_BUILD_CXX_FLAGS "-tWR") +SET(CMAKE_SHARED_BUILD_C_FLAGS "-tWR") SET(CMAKE_START_TEMP_FILE "@&&|\n") SET(CMAKE_END_TEMP_FILE "\n|") @@ -20,7 +33,7 @@ SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) # create a C shared library SET(CMAKE_C_CREATE_SHARED_LIBRARY - "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE}-e<TARGET> -tWD <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>${CMAKE_END_TEMP_FILE}" + "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE}-e<TARGET> -tWD <LINK_FLAGS> -tWR <LINK_LIBRARIES> <OBJECTS>${CMAKE_END_TEMP_FILE}" "implib ${CMAKE_START_TEMP_FILE}-w <TARGET_BASE>.lib <TARGET_BASE>.dll${CMAKE_END_TEMP_FILE}" ) diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 49ce91d..f9a93e9 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -2194,7 +2194,6 @@ OutputBuildObjectFromSource(std::ostream& fout, { flags += extraCompileFlags; } - flags += "$(INCLUDE_FLAGS) "; std::string sourceFile = cmSystemTools::ConvertToOutputPath(source.GetFullPath().c_str()); std::string buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE"); @@ -2217,6 +2216,11 @@ OutputBuildObjectFromSource(std::ostream& fout, { flags += this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_C_FLAGS"); flags += " "; + } + if(cmSystemTools::IsOn(m_Makefile->GetDefinition("BUILD_SHARED_LIBS"))) + { + flags += this->GetSafeDefinition("CMAKE_SHARED_BUILD_C_FLAGS"); + flags += " "; } break; } @@ -2272,6 +2276,7 @@ OutputBuildObjectFromSource(std::ostream& fout, sourceFile.c_str()); break; } + flags += "$(INCLUDE_FLAGS) "; // expand multi-command semi-colon separated lists // of commands into separate commands std::vector<std::string> commands; |