summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorDeniz Bahadir <dbahadir@benocs.com>2020-09-22 12:04:26 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-23 14:05:55 (GMT)
commit2f76e7429b96ae05e5f63d6458555a06b19c62e5 (patch)
tree8496837a64a4165fa340017e45d6fc43bcaa780b /Source/cmGeneratorTarget.cxx
parentd575ecc9dedd214ebd941913b81124a674be5008 (diff)
downloadCMake-2f76e7429b96ae05e5f63d6458555a06b19c62e5.zip
CMake-2f76e7429b96ae05e5f63d6458555a06b19c62e5.tar.gz
CMake-2f76e7429b96ae05e5f63d6458555a06b19c62e5.tar.bz2
OBJECT libraries: Properly recognize if sources depend on configuration
Fixes: #21198
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx18
1 files changed, 13 insertions, 5 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index d9b2f66..8589ab1 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -276,8 +276,8 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
, DebugLinkDirectoriesDone(false)
, DebugPrecompileHeadersDone(false)
, DebugSourcesDone(false)
- , SourcesAreContextDependent(true)
, UtilityItemsDone(false)
+ , SourcesAreContextDependent(Tribool::Indeterminate)
{
this->Makefile = this->Target->GetMakefile();
this->LocalGenerator = lg;
@@ -692,7 +692,7 @@ void cmGeneratorTarget::ClearSourcesCache()
{
this->AllConfigSources.clear();
this->KindedSourcesMap.clear();
- this->SourcesAreContextDependent = true;
+ this->SourcesAreContextDependent = Tribool::Indeterminate;
this->Objects.clear();
this->VisitedConfigsForObjects.clear();
}
@@ -1653,10 +1653,13 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetSourceFilePaths(
uniqueSrcs, debugSources);
}
+ // Determine if sources are context-dependent or not.
if (!contextDependentDirectSources &&
!(contextDependentInterfaceSources && numFilesBefore < files.size()) &&
!(contextDependentObjects && numFilesBefore2 < files.size())) {
- this->SourcesAreContextDependent = false;
+ this->SourcesAreContextDependent = Tribool::False;
+ } else {
+ this->SourcesAreContextDependent = Tribool::True;
}
return files;
@@ -1731,9 +1734,9 @@ cmGeneratorTarget::GetSourceFilesWithoutObjectLibraries(
cmGeneratorTarget::KindedSources const& cmGeneratorTarget::GetKindedSources(
std::string const& config) const
{
- // If we already processed one configuration and found no dependenc
+ // If we already processed one configuration and found no dependency
// on configuration then always use the one result.
- if (!this->SourcesAreContextDependent) {
+ if (this->SourcesAreContextDependent == Tribool::False) {
return this->KindedSourcesMap.begin()->second;
}
@@ -7518,6 +7521,11 @@ bool cmGeneratorTarget::GetImplibGNUtoMS(std::string const& config,
return false;
}
+bool cmGeneratorTarget::HasContextDependentSources() const
+{
+ return this->SourcesAreContextDependent == Tribool::True;
+}
+
bool cmGeneratorTarget::IsExecutableWithExports() const
{
return (this->GetType() == cmStateEnums::EXECUTABLE &&