cmTarget: Add HasKnownObjectFileLocation() shorthand

Allow `cmGlobalGenerator`s to decide `HasKnownObjectFileLocation()` per given
`cmTarget`

- `cmGlobalGenerator::HasKnownObjectFileLocation()` now takes an optional `cmGeneratorTarget`
- `cmTarget::HasKnownObjectFileLocation()` added as a shorthand
This commit is contained in:
Hyper Nova Sun
2022-04-08 13:22:08 -07:00
parent 7fc248bde3
commit 41ba35a42b
9 changed files with 21 additions and 11 deletions

View File

@@ -195,7 +195,7 @@ cmStateEnums::TargetType cmExportBuildFileGenerator::GetExportTargetType(
// to support transitive usage requirements on other targets that
// use the object library.
if (targetType == cmStateEnums::OBJECT_LIBRARY &&
!this->LG->GetGlobalGenerator()->HasKnownObjectFileLocation(nullptr)) {
!target->Target->HasKnownObjectFileLocation(nullptr)) {
targetType = cmStateEnums::INTERFACE_LIBRARY;
}
return targetType;