diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2018-12-13 15:14:59 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2018-12-19 08:41:27 (GMT) |
commit | f255280fd908e4ef1af5eba6230e81b74d339855 (patch) | |
tree | 2fcccac786e1b8e967c57e9e9230d30040177a2a /Source/cmLocalGenerator.cxx | |
parent | 3bd814460161f3af682e116aa561efcc30793eff (diff) | |
download | CMake-f255280fd908e4ef1af5eba6230e81b74d339855.zip CMake-f255280fd908e4ef1af5eba6230e81b74d339855.tar.gz CMake-f255280fd908e4ef1af5eba6230e81b74d339855.tar.bz2 |
PIE link options: Update strategy to fix performance regression
Fixes: #18700
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index da48950..8fac039 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2044,8 +2044,14 @@ void cmLocalGenerator::AppendPositionIndependentLinkerFlags( return; } - std::string name = "CMAKE_" + lang + "_LINK_OPTIONS_"; - name += cmSystemTools::IsOn(PICValue) ? "PIE" : "NO_PIE"; + const std::string mode = cmSystemTools::IsOn(PICValue) ? "PIE" : "NO_PIE"; + + std::string supported = "CMAKE_" + lang + "_LINK_" + mode + "_SUPPORTED"; + if (cmSystemTools::IsOff(this->Makefile->GetDefinition(supported))) { + return; + } + + std::string name = "CMAKE_" + lang + "_LINK_OPTIONS_" + mode; auto pieFlags = this->Makefile->GetSafeDefinition(name); if (pieFlags.empty()) { |