summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-11-12 14:51:05 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-11-12 14:51:15 (GMT)
commiteae743bf17605c28ee4afd02991d3271efb5c8a9 (patch)
treed2a32c6d4fa109705b2a559da1234683e234f6c8 /Source/cmGeneratorTarget.cxx
parent88e0dca40df9c88e7d9b9d352fe19f63091bc7c3 (diff)
parent9a5418320ea40d61a63fd47e5ac133c3ff780062 (diff)
downloadCMake-eae743bf17605c28ee4afd02991d3271efb5c8a9.zip
CMake-eae743bf17605c28ee4afd02991d3271efb5c8a9.tar.gz
CMake-eae743bf17605c28ee4afd02991d3271efb5c8a9.tar.bz2
Merge topic 'unity-HEADER_FILE_ONLY' into release-3.16
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.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c3ed9e8..d38e9e1 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1569,6 +1569,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")) {
@@ -3588,6 +3590,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