mirror of
https://github.com/reactos/CMake.git
synced 2025-02-21 04:11:03 +00:00
Autogen: Fix for AUTOMOC on macOS frameworks in CMake 3.10
Revert the library target dependency forwarding to the `_autogen` target to the 3.9.6 way, only now using `GetLinkImplementationLibraries`. Fixes: #17278
This commit is contained in:
parent
7746fdb2fe
commit
fcbd02fd6e
@ -1046,40 +1046,39 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
|
|||||||
target->Target->AddPreBuildCommand(cc);
|
target->Target->AddPreBuildCommand(cc);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Convert file dependencies std::set to std::vector
|
|
||||||
std::vector<std::string> autogenDepends(autogenDependFiles.begin(),
|
|
||||||
autogenDependFiles.end());
|
|
||||||
|
|
||||||
// Add link library target dependencies to the autogen target dependencies
|
// Add link library target dependencies to the autogen target dependencies
|
||||||
for (std::string const& config : configsList) {
|
{
|
||||||
cmLinkImplementationLibraries const* libs =
|
// add_dependencies/addUtility do not support generator expressions.
|
||||||
target->GetLinkImplementationLibraries(config);
|
// We depend only on the libraries found in all configs therefore.
|
||||||
if (libs != nullptr) {
|
std::map<cmGeneratorTarget const*, std::size_t> commonTargets;
|
||||||
for (cmLinkItem const& item : libs->Libraries) {
|
for (std::string const& config : configsList) {
|
||||||
cmGeneratorTarget const* libTarget = item.Target;
|
cmLinkImplementationLibraries const* libs =
|
||||||
if ((libTarget != nullptr) &&
|
target->GetLinkImplementationLibraries(config);
|
||||||
!StaticLibraryCycle(target, libTarget, config)) {
|
if (libs != nullptr) {
|
||||||
std::string util;
|
for (cmLinkItem const& item : libs->Libraries) {
|
||||||
if (configsList.size() > 1) {
|
cmGeneratorTarget const* libTarget = item.Target;
|
||||||
util += "$<$<CONFIG:";
|
if ((libTarget != nullptr) &&
|
||||||
util += config;
|
!StaticLibraryCycle(target, libTarget, config)) {
|
||||||
util += ">:";
|
// Increment target config count
|
||||||
|
commonTargets[libTarget]++;
|
||||||
}
|
}
|
||||||
util += libTarget->GetName();
|
|
||||||
if (configsList.size() > 1) {
|
|
||||||
util += ">";
|
|
||||||
}
|
|
||||||
autogenDepends.push_back(util);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (auto const& item : commonTargets) {
|
||||||
|
if (item.second == configsList.size()) {
|
||||||
|
autogenDependTargets.insert(item.first->Target);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create autogen target
|
// Create autogen target
|
||||||
cmTarget* autogenTarget = makefile->AddUtilityCommand(
|
cmTarget* autogenTarget = makefile->AddUtilityCommand(
|
||||||
autogenTargetName, true, workingDirectory.c_str(),
|
autogenTargetName, true, workingDirectory.c_str(),
|
||||||
/*byproducts=*/autogenProvides, autogenDepends, commandLines, false,
|
/*byproducts=*/autogenProvides,
|
||||||
autogenComment.c_str());
|
std::vector<std::string>(autogenDependFiles.begin(),
|
||||||
|
autogenDependFiles.end()),
|
||||||
|
commandLines, false, autogenComment.c_str());
|
||||||
// Create autogen generator target
|
// Create autogen generator target
|
||||||
localGen->AddGeneratorTarget(
|
localGen->AddGeneratorTarget(
|
||||||
new cmGeneratorTarget(autogenTarget, localGen));
|
new cmGeneratorTarget(autogenTarget, localGen));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user