diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2021-09-23 21:05:22 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2021-09-24 15:29:54 (GMT) |
commit | 895fa3433f50b7011fa475a4696dc06fe072aa25 (patch) | |
tree | db914901124fb2dfaf2bb7d258a2915b2388d6e7 /Source/cmQtAutoGenInitializer.cxx | |
parent | 354c1f5628bdc104c9b9cd0436dd4cfa585124ec (diff) | |
download | CMake-895fa3433f50b7011fa475a4696dc06fe072aa25.zip CMake-895fa3433f50b7011fa475a4696dc06fe072aa25.tar.gz CMake-895fa3433f50b7011fa475a4696dc06fe072aa25.tar.bz2 |
cmQtAutoGenInitializer: support IMPLIB-only imported targets
Instead of using the target name directly (which ends up in the `Ninja`
generators querying for the `LOCATION` parameter), wrap up the target
name in a `$<TARGET_LINKER_FILE:>` to avoid the query for the unset
property.
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 4dd78e5..4e3c584 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1306,7 +1306,16 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() // Add additional autogen target dependencies to // '_autogen_timestamp_deps'. for (const cmTarget* t : this->AutogenTarget.DependTargets) { - dependencies.push_back(t->GetName()); + std::string depname = t->GetName(); + if (t->IsImported()) { + auto ttype = t->GetType(); + if (ttype == cmStateEnums::TargetType::STATIC_LIBRARY || + ttype == cmStateEnums::TargetType::SHARED_LIBRARY || + ttype == cmStateEnums::TargetType::UNKNOWN_LIBRARY) { + depname = cmStrCat("$<TARGET_LINKER_FILE:", t->GetName(), ">"); + } + } + dependencies.push_back(depname); } cmTarget* timestampTarget = this->LocalGen->AddUtilityCommand( |