diff options
author | Brad King <brad.king@kitware.com> | 2019-11-12 14:51:05 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-11-12 14:51:16 (GMT) |
commit | 5b46bc319435f429e3e616246e5e39b06f0e7fd0 (patch) | |
tree | 9cdfdc9b88e2a50270fba541b988442e47794cc7 /Source/cmGeneratorTarget.cxx | |
parent | 45f8b10e0c12b3e17315851afd1bcd178225ce6a (diff) | |
parent | 9a5418320ea40d61a63fd47e5ac133c3ff780062 (diff) | |
download | CMake-5b46bc319435f429e3e616246e5e39b06f0e7fd0.zip CMake-5b46bc319435f429e3e616246e5e39b06f0e7fd0.tar.gz CMake-5b46bc319435f429e3e616246e5e39b06f0e7fd0.tar.bz2 |
Merge topic 'unity-HEADER_FILE_ONLY'
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4023
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index dd3fefa..573ad4d 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1563,6 +1563,8 @@ void cmGeneratorTarget::ComputeKindedSources(KindedSources& files, kind = SourceKindCustomCommand; } else if (this->Target->GetType() == cmStateEnums::UTILITY) { kind = SourceKindExtra; + } else if (this->IsSourceFilePartOfUnityBatch(sf->ResolveFullPath())) { + kind = SourceKindUnityBatched; } else if (sf->GetPropertyAsBool("HEADER_FILE_ONLY")) { kind = SourceKindHeader; } else if (sf->GetPropertyAsBool("EXTERNAL_OBJECT")) { @@ -3604,6 +3606,23 @@ std::string cmGeneratorTarget::GetPchUseCompileOptions( return inserted.first->second; } +void cmGeneratorTarget::AddSourceFileToUnityBatch( + const std::string& sourceFilename) +{ + this->UnityBatchedSourceFiles.insert(sourceFilename); +} + +bool cmGeneratorTarget::IsSourceFilePartOfUnityBatch( + const std::string& sourceFilename) const +{ + if (!this->GetPropertyAsBool("UNITY_BUILD")) { + return false; + } + + return this->UnityBatchedSourceFiles.find(sourceFilename) != + this->UnityBatchedSourceFiles.end(); +} + void cmGeneratorTarget::GetLinkOptions(std::vector<std::string>& result, const std::string& config, const std::string& language) const |