diff options
author | Brad King <brad.king@kitware.com> | 2021-02-19 16:21:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-19 16:25:03 (GMT) |
commit | d9fd32b3b347327adb146284b543ec8e97cae6bd (patch) | |
tree | d8e0ead2087ec798e984a982339731c3e97e1553 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 48410610a6636a73d4313479b7799c542b0d4553 (diff) | |
download | CMake-d9fd32b3b347327adb146284b543ec8e97cae6bd.zip CMake-d9fd32b3b347327adb146284b543ec8e97cae6bd.tar.gz CMake-d9fd32b3b347327adb146284b543ec8e97cae6bd.tar.bz2 |
cmVisualStudio10TargetGenerator: Refactor per-source PCH logic
De-duplicate the link language lookup.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index a93a78a..50a456d 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2413,16 +2413,16 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( // 1. We have SKIP_PRECOMPILE_HEADERS == true // 2. We are creating the pre-compiled header // 3. We are a different language than the linker language AND pch is - // enabled - const std::string pchSource = + // enabled. + std::string const& linkLanguage = + this->GeneratorTarget->GetLinkerLanguage(config); + std::string const& pchSource = this->GeneratorTarget->GetPchSource(config, lang); const bool skipPCH = pchSource.empty() || sf.GetPropertyAsBool("SKIP_PRECOMPILE_HEADERS"); const bool makePCH = (sf.GetFullPath() == pchSource); - const bool useSharedPCH = - !skipPCH && (lang == this->GeneratorTarget->GetLinkerLanguage(config)); - const bool useDifferentLangPCH = - !skipPCH && (lang != this->GeneratorTarget->GetLinkerLanguage(config)); + const bool useSharedPCH = !skipPCH && (lang == linkLanguage); + const bool useDifferentLangPCH = !skipPCH && (lang != linkLanguage); const bool needsPCHFlags = (makePCH || useSharedPCH || useDifferentLangPCH); |