From 1e4cd9f26fdae27e8253f5b214260830d719953b Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 4 Sep 2021 23:46:20 +0800 Subject: mergelib for lib.exe --- xmake/modules/utils/archive/merge_staticlib.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xmake/modules/utils/archive/merge_staticlib.lua b/xmake/modules/utils/archive/merge_staticlib.lua index cbafa4bdb..dc0130219 100644 --- a/xmake/modules/utils/archive/merge_staticlib.lua +++ b/xmake/modules/utils/archive/merge_staticlib.lua @@ -20,6 +20,7 @@ -- imports import("core.base.option") +import("private.tools.vstool") -- merge *.a archive libraries for ar function _merge_for_ar(target, program, outputfile, libraryfiles, opt) @@ -44,6 +45,7 @@ end -- merge *.a archive libraries for msvc/lib.exe function _merge_for_msvclib(target, program, outputfile, libraryfiles, opt) opt = opt or {} + vstool.runv(program, table.join("-nologo", "-out:" .. outputfile, libraryfiles), {envs = opt.runenvs}) end -- merge *.a archive libraries @@ -60,7 +62,7 @@ function main(target, outputfile, libraryfiles) break end end - _merge_for_msvclib(target, (program:gsub("link%.exe", "lib.exe")), outputfile, libraryfiles, {envs = msvc and msvc:runenvs()}) + _merge_for_msvclib(target, (program:gsub("link%.exe", "lib.exe")), outputfile, libraryfiles, {runenvs = msvc and msvc:runenvs()}) else raise("cannot merge (%s): unknown ar tool %s!", table.concat(libraryfiles, ", "), toolname) end -- cgit v1.3.1