summaryrefslogtreecommitdiff
path: root/xmake/modules/utils/binary
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/utils/binary')
-rw-r--r--xmake/modules/utils/binary/deplibs.lua12
-rw-r--r--xmake/modules/utils/binary/rpath.lua3
2 files changed, 5 insertions, 10 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
diff --git a/xmake/modules/utils/binary/rpath.lua b/xmake/modules/utils/binary/rpath.lua
index 6ee17e98d..2e74443ad 100644
--- a/xmake/modules/utils/binary/rpath.lua
+++ b/xmake/modules/utils/binary/rpath.lua
@@ -55,8 +55,7 @@ function _get_rpath_list_by_objdump(binaryfile, opt)
if result then
local cmd = false
for _, line in ipairs(result:split("\n")) do
- local line = line
- 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