diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2019-10-05 10:20:37 (GMT) |
---|---|---|
committer | Cristian Adam <cristian.adam@gmail.com> | 2019-10-09 11:50:25 (GMT) |
commit | 36ded610af1bf80304a35491eeb66c34c8e9b7a8 (patch) | |
tree | d41161cbbaafe3ecbe04aefffdc40e9e5adc6fae /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | f1fb63b306ad06a8931ca5a00a2b9ce9e66bc12e (diff) | |
download | CMake-36ded610af1bf80304a35491eeb66c34c8e9b7a8.zip CMake-36ded610af1bf80304a35491eeb66c34c8e9b7a8.tar.gz CMake-36ded610af1bf80304a35491eeb66c34c8e9b7a8.tar.bz2 |
PCH: Generate sources during Compute step
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 34556f9..3843bf2 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -250,8 +250,6 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator( this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); this->InSourceBuild = (this->Makefile->GetCurrentSourceDirectory() == this->Makefile->GetCurrentBinaryDirectory()); - - this->LocalGenerator->AddPchDependencies(target, ""); } cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator() @@ -2330,10 +2328,28 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( cmGeneratorExpression::Find(ccdefs) != std::string::npos; configDefines += ccdefs; } + + // Add precompile headers compile options. + std::string customAndPchOptions = options; + const std::string pchSource = + this->GeneratorTarget->GetPchSource(config, lang); + if (!pchSource.empty() && !sf.GetProperty("SKIP_PRECOMPILE_HEADERS")) { + std::string pchOptions; + if (sf.GetFullPath() == pchSource) { + pchOptions = + this->GeneratorTarget->GetPchCreateCompileOptions(config, lang); + } else { + pchOptions = + this->GeneratorTarget->GetPchUseCompileOptions(config, lang); + } + customAndPchOptions += pchOptions; + } + // if we have flags or defines for this config then // use them if (!flags.empty() || !options.empty() || !configDefines.empty() || - !includes.empty() || compileAs || noWinRT) { + !includes.empty() || compileAs || noWinRT || + !customAndPchOptions.empty()) { cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator; cmIDEFlagTable const* flagtable = nullptr; const std::string& srclang = source->GetLanguage(); @@ -2366,14 +2382,15 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( } else { clOptions.Parse(flags); } - if (!options.empty()) { + if (!customAndPchOptions.empty()) { std::string expandedOptions; if (configDependentOptions) { this->LocalGenerator->AppendCompileOptions( expandedOptions, - genexInterpreter.Evaluate(options, "COMPILE_OPTIONS")); + genexInterpreter.Evaluate(customAndPchOptions, "COMPILE_OPTIONS")); } else { - this->LocalGenerator->AppendCompileOptions(expandedOptions, options); + this->LocalGenerator->AppendCompileOptions(expandedOptions, + customAndPchOptions); } clOptions.Parse(expandedOptions); } |