summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxiaobfly <[email protected]>2024-07-29 10:08:14 +0800
committerxiaobfly <[email protected]>2024-07-29 10:08:14 +0800
commite7950146e3f157909f1bf74f7ab742f0d445503a (patch)
tree38036c2431d3e1cc20ea51cb9df9823ed543e2ce
parent69ea60450564fc93c65f111b526c872689656f9c (diff)
fix:
not append .lib when link .obj file. for example: static qt will link these files: $$[QT_INSTALL_PREFIX]/lib/objects-Debug/Widgets_resources_1/.rcc/qrc_qstyle.cpp.obj $$[QT_INSTALL_PREFIX]/lib/objects-Debug/Widgets_resources_2/.rcc/qrc_qstyle1.cpp.obj $$[QT_INSTALL_PREFIX]/lib/objects-Debug/Widgets_resources_3/.rcc/qrc_qmessagebox.cpp.obj $$[QT_INSTALL_PREFIX]/lib/objects-Debug/Gui_resources_1/.rcc/qrc_qpdf.cpp.obj $$[QT_INSTALL_PREFIX]/lib/objects-Debug/Gui_resources_2/.rcc/qrc_gui_shaders.cpp.obj have a link error: error: LINK fatal error LNK1104: can't open file "$$[QT_INSTALLPREFIX]\Lib\objects-Debug\widgets_resources1\.rcc\qrc_qstyle.cpp.obj.lib"
-rw-r--r--xmake/modules/core/tools/link.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua
index a144d515e..3e51ad40a 100644
--- a/xmake/modules/core/tools/link.lua
+++ b/xmake/modules/core/tools/link.lua
@@ -102,7 +102,7 @@ end
-- make the link flag
function nf_link(self, lib)
- if not lib:endswith(".lib") then
+ if not lib:endswith(".lib") and not lib:endswith(".obj") then
lib = lib .. ".lib"
end
return lib