From fe82a0530782f236cd7ccf686134f06fead3a6eb Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 11 Nov 2024 22:27:03 +0800 Subject: [PATCH] improve cp exe --- packages/v/verilator/xmake.lua | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index c70ce4968..fcacc4485 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -84,21 +84,24 @@ package("verilator") end cmake.install(package, configs, opt) - local bindir = package:installdir("bin") - local subfix = (is_host("windows") and ".exe" or "") - local verilator = path.join(bindir, "verilator" .. subfix) - if not os.isfile(verilator) then - local verilator_bin = "verilator_bin" - if package:is_debug() then - verilator_bin = verilator_bin .. "_dbg" + if is_host("windows") then + local bindir = package:installdir("bin") + local verilator = path.join(bindir, "verilator.exe") + if not os.isfile(verilator) then + local verilator_bin = "verilator_bin" + if package:is_debug() then + verilator_bin = verilator_bin .. "_dbg" + end + verilator_bin = path.join(bindir, verilator_bin .. ".exe") + os.trycp(verilator_bin, verilator) + end + + if package:is_plat("windows") and package:is_debug() then + os.vcp(path.join(package:buildir(), "**.pdb"), package:installdir("bin")) end - verilator_bin = path.join(bindir, verilator_bin .. subfix) - os.trycp(verilator_bin, verilator) end end) on_test(function (package) - if not package:is_cross() then - os.vrun("verilator --version") - end + os.vrun("verilator --version") end)