summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2024-07-22 15:06:04 (GMT)
committerOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2024-07-23 14:58:43 (GMT)
commitfb978f001d7574fd91f8c87f37990ac03fc8dfaf (patch)
treec6462c38709f66e1e1743cf7272cc5eb28790b03 /Source/cmGeneratorTarget.cxx
parent7d8d23957448ef8d70e3f3643d69d3e06ad5a071 (diff)
downloadCMake-fb978f001d7574fd91f8c87f37990ac03fc8dfaf.zip
CMake-fb978f001d7574fd91f8c87f37990ac03fc8dfaf.tar.gz
CMake-fb978f001d7574fd91f8c87f37990ac03fc8dfaf.tar.bz2
GeneratorTarget: Fix missing system include cache key
When 033dc7ee2f02b0ebdfd1bc4edbcb24d1fc8c4152 introduced `AddSystemIncludeDirectory()`, the function was not handling the situation which a system include cache key is not added properly like in `IsSystemIncludeDirectory()`. The error was not exposed when `AUTOMOC` is `ON` and `AUTOUIC` is `ON` because `GetIncludeDirectoriesImplicit()` inside `initMoc()` was triggering `IsSystemIncludeDirectory()`. This commit adds calling `AddSystemIncludeCacheKey()` inside `AddSystemIncludeDirectory()` when the system include cache key is not added before. Fixes: #26146
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 6320bd3..9f814c2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -585,6 +585,10 @@ void cmGeneratorTarget::AddSystemIncludeDirectory(std::string const& inc,
}
auto const& key = cmStrCat(config_upper, "/", lang);
this->Target->AddSystemIncludeDirectories({ inc_with_config });
+ if (this->SystemIncludesCache.find(key) ==
+ this->SystemIncludesCache.end()) {
+ this->AddSystemIncludeCacheKey(key, config, lang);
+ }
this->SystemIncludesCache[key].emplace_back(inc_with_config);
// SystemIncludesCache should be sorted so that binary search can be used