diff options
| author | ruki <[email protected]> | 2026-03-29 22:55:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-03-29 22:55:28 +0800 |
| commit | 8841ed9f7b427896f042abcfb3537dd731f6a923 (patch) | |
| tree | d2cb01d00f1873851e86199deef19dda20c43702 /xmake/modules/utils/binary/deplibs.lua | |
| parent | 1bccfc273af2b1d579d033324bca481e15c58653 (diff) | |
improve const limit codes
Diffstat (limited to 'xmake/modules/utils/binary/deplibs.lua')
| -rw-r--r-- | xmake/modules/utils/binary/deplibs.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/xmake/modules/utils/binary/deplibs.lua b/xmake/modules/utils/binary/deplibs.lua index e1a9a776d..56029ef20 100644 --- a/xmake/modules/utils/binary/deplibs.lua +++ b/xmake/modules/utils/binary/deplibs.lua @@ -44,8 +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 - local line = line - 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) @@ -72,8 +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 - local line = line - 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 @@ -205,8 +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 - local line = line - line = line:trim() + local line = line:trim() if not line:endswith(":") then local filename = line:match(".-%.dylib") or line:match(".-%.framework") if filename then @@ -348,8 +345,7 @@ function _get_plain_depends(binaryfile, opt) if depends and opt.resolve_path then local result = {} for _, dependfile in ipairs(depends) do - local dependfile = dependfile - dependfile = _resolve_filepath(binaryfile, dependfile, opt) + local dependfile = _resolve_filepath(binaryfile, dependfile, opt) if dependfile then table.insert(result, dependfile) end |
