diff options
author | Ken Martin <ken.martin@kitware.com> | 2005-07-14 14:15:36 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2005-07-14 14:15:36 (GMT) |
commit | 903541f49c682b4c641561608542abed2d64998d (patch) | |
tree | b3e1686de0371ffe8a5a8022c42927df123c89cd | |
parent | 1b95674b0ec096410163a324ef05a375d91f2261 (diff) | |
download | CMake-903541f49c682b4c641561608542abed2d64998d.zip CMake-903541f49c682b4c641561608542abed2d64998d.tar.gz CMake-903541f49c682b4c641561608542abed2d64998d.tar.bz2 |
BUG: add support for borland exe with shared libs back in
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index e8f3016..c78317c 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1373,6 +1373,36 @@ cmLocalUnixMakefileGenerator3 // Add flags to create an executable. this->AddConfigVariableFlags(linkFlags, "CMAKE_EXE_LINKER_FLAGS"); + + + // Loop over all libraries and see if all are shared + const cmTarget::LinkLibraries& tlibs = target.GetLinkLibraries(); + int AllShared = 2; // 0 = false, 1 = true, 2 = unknown + for(cmTarget::LinkLibraries::const_iterator lib = tlibs.begin(); + lib != tlibs.end(); ++lib) + { + // look up the target if there is one + cmTarget *libtgt = m_GlobalGenerator->FindTarget(0,lib->first.c_str()); + if (libtgt) + { + if (libtgt->GetType() != cmTarget::SHARED_LIBRARY) + { + AllShared = 0; + } + else if (AllShared == 2) + { + AllShared = 1; + } + } + } + + // if all libs were shared then add the special borland flag for linking an + // executable to only shared libs + if(AllShared == 1) + { + this->AppendFlags + (linkFlags,m_Makefile->GetDefinition("CMAKE_SHARED_BUILD_CXX_FLAGS")); + } if(target.GetPropertyAsBool("WIN32_EXECUTABLE")) { this->AppendFlags(linkFlags, |