Do not use -fPIC to link executables

The commit "add support for borland run time flag for shared builds"
started using the value of CMAKE_SHARED_LIBRARY_CXX_FLAGS to link
executables because Borland requires some flags both at compile and link
time.  This change ended up propagating all the way to the current
Makefile generators and the behavior applies on all platforms.

In general it is incorrect to use these flags to link executables.  The
commit "Split Borland compiler information files" re-wrote Borland
support to work without this behavior, so we remove it in this commit.

Patch from Ben Hutchings.  See issue #9659.
This commit is contained in:
Brad King 2009-10-08 11:56:30 -04:00
parent 0653286dc6
commit 65b6a8f54a
1 changed files with 0 additions and 5 deletions

View File

@ -199,11 +199,6 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string flags;
std::string linkFlags;
// Add flags to deal with shared libraries. Any library being
// linked in might be shared, so always use shared flags for an
// executable.
this->LocalGenerator->AddSharedFlags(linkFlags, linkLanguage, true);
// Add flags to create an executable.
this->LocalGenerator->
AddConfigVariableFlags(linkFlags, "CMAKE_EXE_LINKER_FLAGS",