mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-07 13:56:44 +00:00
cmTarget: avoid creating export entries if they don't exist
This commit is contained in:
1 parent
0513a1fe10
commit
499009b79c
1 file changed
+6
-1
+6
-1
@@ -1291,7 +1291,12 @@ void cmTarget::AddInstallIncludeDirectories(cmTargetExport const& te,
|
||||
cmStringRange cmTarget::GetInstallIncludeDirectoriesEntries(
|
||||
cmTargetExport const& te) const
|
||||
{
|
||||
return cmMakeRange(this->impl->InstallIncludeDirectoriesEntries[&te]);
|
||||
auto i = this->impl->InstallIncludeDirectoriesEntries.find(&te);
|
||||
if (i == this->impl->InstallIncludeDirectoriesEntries.end()) {
|
||||
decltype(i->second) empty;
|
||||
return cmMakeRange(empty);
|
||||
}
|
||||
return cmMakeRange(i->second);
|
||||
}
|
||||
|
||||
cmBTStringRange cmTarget::GetIncludeDirectoriesEntries() const
|
||||
|
||||
Reference in new issue
Block a user