From e7950146e3f157909f1bf74f7ab742f0d445503a Mon Sep 17 00:00:00 2001 From: xiaobfly Date: Mon, 29 Jul 2024 10:08:14 +0800 Subject: 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" --- xmake/modules/core/tools/link.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmake/modules/core') 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 -- cgit v1.3.1