void-packages/srcpkgs/cmake/patches/ar-lwyu.patch
Đoàn Trần Công Danh 8d3d86fe7e cmake: update to 3.21.1.
2021-08-06 20:06:57 +07:00

20 lines
847 B
Diff

Fix darktable build
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 5a4c6521d8..55b804d643 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -1157,7 +1157,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
this->AddModuleDefinitionFlag(linkLineComputer.get(), vars["LINK_FLAGS"],
config);
if (gt->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
- vars["LINK_FLAGS"] += " -Wl,--no-as-needed";
+ switch (targetType) {
+ case cmStateEnums::EXECUTABLE:
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::MODULE_LIBRARY:
+ vars["LINK_FLAGS"] += " -Wl,--no-as-needed";
+ break;
+ }
}
vars["LINK_FLAGS"] = globalGen->EncodeLiteral(vars["LINK_FLAGS"]);