diff options
| author | ruki <[email protected]> | 2021-09-04 23:43:32 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-09-04 23:43:32 +0800 |
| commit | b54c309384c334c265072e15a23692e52f11b0b7 (patch) | |
| tree | d78d70c0f2ba313943babc1717e8b3b5a75a07a4 /xmake/modules/utils/archive/merge_staticlib.lua | |
| parent | feefe1dce66ea47e4a968887fbcb81cb0f9caf33 (diff) | |
improve merge lib for ar
Diffstat (limited to 'xmake/modules/utils/archive/merge_staticlib.lua')
| -rw-r--r-- | xmake/modules/utils/archive/merge_staticlib.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/xmake/modules/utils/archive/merge_staticlib.lua b/xmake/modules/utils/archive/merge_staticlib.lua index b5adbd98f..cbafa4bdb 100644 --- a/xmake/modules/utils/archive/merge_staticlib.lua +++ b/xmake/modules/utils/archive/merge_staticlib.lua @@ -27,7 +27,17 @@ function _merge_for_ar(target, program, outputfile, libraryfiles, opt) if target:is_plat("macosx", "iphoneos", "watchos", "appletvos") then os.vrunv("libtool", table.join("-static", "-o", outputfile, libraryfiles)) else - os.vrunv(program, table.join("crsT", outputfile, libraryfiles)) + local tmpfile = os.tmpfile() + local mrifile = io.open(tmpfile, "w") + mrifile:print("create %s", outputfile) + for _, libraryfile in ipairs(libraryfiles) do + mrifile:print("addlib %s", libraryfile) + end + mrifile:print("save") + mrifile:print("end") + mrifile:close() + os.vrunv(program, {"-M"}, {stdin = tmpfile}) + os.rm(tmpfile) end end |
