diff options
Diffstat (limited to 'xmake/modules/utils/binary')
| -rw-r--r-- | xmake/modules/utils/binary/deplibs.lua | 9 | ||||
| -rw-r--r-- | xmake/modules/utils/binary/rpath.lua | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/xmake/modules/utils/binary/deplibs.lua b/xmake/modules/utils/binary/deplibs.lua index 1de8056fd..56029ef20 100644 --- a/xmake/modules/utils/binary/deplibs.lua +++ b/xmake/modules/utils/binary/deplibs.lua @@ -44,7 +44,7 @@ function _get_depends_by_dumpbin(binaryfile, opt) local result = try { function () return os.iorunv(dumpbin.program, {"/dependents", "/nologo", binaryfile}) end } if result then for _, line in ipairs(result:split("\n")) do - line = line:trim() + local line = line:trim() if not line:startswith("Dump of file") and line:endswith(".dll") then depends = depends or {} table.insert(depends, line) @@ -71,7 +71,7 @@ function _get_depends_by_objdump(binaryfile, opt) local result = try { function () return os.iorunv(objdump.program, argv) end } if result then for _, line in ipairs(result:split("\n")) do - line = line:trim() + local line = line:trim() if not line:endswith(":") then if plat == "windows" or plat == "mingw" then if line:startswith("DLL Name:") then @@ -126,6 +126,7 @@ function _get_depends_by_ldd(binaryfile, opt) local result = try { function () return os.iorunv(ldd.program, {binaryfile}) end } if result then for _, line in ipairs(result:split("\n")) do + local line = line local splitinfo = line:split("=>") line = splitinfo[2] if not line or line:find("not found", 1, true) then @@ -202,7 +203,7 @@ function _get_depends_by_otool(binaryfile, opt) local result = try { function () return os.iorunv(otool.program, {"-L", binaryfile}) end } if result then for _, line in ipairs(result:split("\n")) do - line = line:trim() + local line = line:trim() if not line:endswith(":") then local filename = line:match(".-%.dylib") or line:match(".-%.framework") if filename then @@ -344,7 +345,7 @@ function _get_plain_depends(binaryfile, opt) if depends and opt.resolve_path then local result = {} for _, dependfile in ipairs(depends) do - dependfile = _resolve_filepath(binaryfile, dependfile, opt) + local dependfile = _resolve_filepath(binaryfile, dependfile, opt) if dependfile then table.insert(result, dependfile) end diff --git a/xmake/modules/utils/binary/rpath.lua b/xmake/modules/utils/binary/rpath.lua index 33cab5a43..2e74443ad 100644 --- a/xmake/modules/utils/binary/rpath.lua +++ b/xmake/modules/utils/binary/rpath.lua @@ -55,7 +55,7 @@ function _get_rpath_list_by_objdump(binaryfile, opt) if result then local cmd = false for _, line in ipairs(result:split("\n")) do - line = line:trim() + local line = line:trim() if plat == "macosx" or plat == "iphoneos" or plat == "appletvos" or plat == "watchos" then if not cmd and line:find("cmd LC_RPATH", 1, true) then cmd = true |
