From 65b6a8f54a90b2eff3dbacc01fbd25675308b77a Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 8 Oct 2009 11:56:30 -0400 Subject: [PATCH] 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. --- Source/cmMakefileExecutableTargetGenerator.cxx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 16e226608..a20c91721 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -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",