From 945195e1a2b35908cbec1bd1fa16f84683903545 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 7 Jul 2024 22:45:55 +0800 Subject: fix find ld --- xmake/modules/detect/tools/find_ld.lua | 6 +----- xmake/modules/detect/tools/find_ld64_lld.lua | 1 + xmake/modules/detect/tools/find_ld_lld.lua | 1 + xmake/modules/detect/tools/find_ldc2.lua | 9 +-------- xmake/modules/detect/tools/find_lld_link.lua | 1 + 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/xmake/modules/detect/tools/find_ld.lua b/xmake/modules/detect/tools/find_ld.lua index cadcbfeec..802367400 100644 --- a/xmake/modules/detect/tools/find_ld.lua +++ b/xmake/modules/detect/tools/find_ld.lua @@ -36,11 +36,7 @@ import("lib.detect.find_program") -- @endcode -- function main(opt) - - -- init options - opt = opt or {} + opt = opt or {} opt.norun = true - - -- find program return find_program(opt.program or "ld", opt) end diff --git a/xmake/modules/detect/tools/find_ld64_lld.lua b/xmake/modules/detect/tools/find_ld64_lld.lua index eacfe3899..42dc339d3 100644 --- a/xmake/modules/detect/tools/find_ld64_lld.lua +++ b/xmake/modules/detect/tools/find_ld64_lld.lua @@ -21,6 +21,7 @@ -- imports import("core.tool.compiler") import("lib.detect.find_program") +import("lib.detect.find_programver") -- find ar -- diff --git a/xmake/modules/detect/tools/find_ld_lld.lua b/xmake/modules/detect/tools/find_ld_lld.lua index d7078e1d2..430d00bcd 100644 --- a/xmake/modules/detect/tools/find_ld_lld.lua +++ b/xmake/modules/detect/tools/find_ld_lld.lua @@ -21,6 +21,7 @@ -- imports import("core.tool.compiler") import("lib.detect.find_program") +import("lib.detect.find_programver") -- find ar -- diff --git a/xmake/modules/detect/tools/find_ldc2.lua b/xmake/modules/detect/tools/find_ldc2.lua index 129c87803..3ab89b018 100644 --- a/xmake/modules/detect/tools/find_ldc2.lua +++ b/xmake/modules/detect/tools/find_ldc2.lua @@ -35,21 +35,14 @@ import("lib.detect.find_programver") -- @endcode -- function main(opt) - - -- init options opt = opt or {} opt.command = opt.command or "--version" opt.parse = opt.parse or function (output) return output:match("%((%d+%.?%d*%.?%d*.-)%)") end - -- find program - local program = find_program(opt.program or "ldc2", opt) - - -- find program version local version = nil + local program = find_program(opt.program or "ldc2", opt) if program and opt and opt.version then version = find_programver(program, opt) end - - -- ok? return program, version end diff --git a/xmake/modules/detect/tools/find_lld_link.lua b/xmake/modules/detect/tools/find_lld_link.lua index 73f6f5694..18641afdf 100644 --- a/xmake/modules/detect/tools/find_lld_link.lua +++ b/xmake/modules/detect/tools/find_lld_link.lua @@ -21,6 +21,7 @@ -- imports import("core.tool.compiler") import("lib.detect.find_program") +import("lib.detect.find_programver") -- find ar -- -- cgit v1.3.1