mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 12:19:54 -05:00
Add SYSTEM target property
If it is ON, treat INTERFACE_INCLUDE_DIRECTORIES as system include directories. Issue: #18040 Signed-off-by: Da Quexian <daquexian566@gmail.com>
This commit is contained in:
@@ -807,11 +807,16 @@ void handleSystemIncludesDep(cmLocalGenerator* lg,
|
||||
dagChecker, depTgt, language),
|
||||
result);
|
||||
}
|
||||
if (!depTgt->IsImported() || excludeImported) {
|
||||
if (!depTgt->GetPropertyAsBool("SYSTEM")) {
|
||||
return;
|
||||
}
|
||||
if (depTgt->GetPropertyAsBool("IMPORTED_NO_SYSTEM")) {
|
||||
return;
|
||||
if (depTgt->IsImported()) {
|
||||
if (excludeImported) {
|
||||
return;
|
||||
}
|
||||
if (depTgt->GetPropertyAsBool("IMPORTED_NO_SYSTEM")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (cmValue dirs = depTgt->GetProperty("INTERFACE_INCLUDE_DIRECTORIES")) {
|
||||
|
||||
@@ -759,6 +759,10 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
||||
}
|
||||
}
|
||||
|
||||
if (this->IsImported()) {
|
||||
this->SetProperty("SYSTEM", "ON");
|
||||
}
|
||||
|
||||
for (auto const& prop : mf->GetState()->GetPropertyDefinitions().GetMap()) {
|
||||
if (prop.first.second == cmProperty::TARGET &&
|
||||
!prop.second.GetInitializeFromVariable().empty()) {
|
||||
|
||||
Reference in New Issue
Block a user