summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-14 22:47:16 +0800
committerruki <[email protected]>2023-01-14 22:47:16 +0800
commita9c7152577fcf9d25da945e2f42d418cc4a5ff1b (patch)
tree5f9ddb847b335e65b0ec125c6adb47a711a520f2
parent39c9b4f33db3d41a304fee2b380917713589efbb (diff)
fix verilator on windows
-rw-r--r--xmake/rules/verilator/verilator.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/rules/verilator/verilator.lua b/xmake/rules/verilator/verilator.lua
index 376a8dcb0..9b8856704 100644
--- a/xmake/rules/verilator/verilator.lua
+++ b/xmake/rules/verilator/verilator.lua
@@ -73,7 +73,7 @@ function config(target)
local tmpdir = os.tmpfile() .. ".dir"
local cmakefile = path.join(tmpdir, "test.cmake")
local sourcefile = path.join(tmpdir, "main.v")
- local argv = {"--cc", "--make", "cmake", "--prefix", "test", "--Mdir", tmpdir, sourcefile}
+ local argv = {"--cc", "--make", "cmake", "--prefix", "test", "--Mdir", tmpdir, "main.v"}
local flags = target:values("verilator.flags")
if flags then
for _, flag in ipairs(flags) do
@@ -94,7 +94,9 @@ $finish ;
end
endmodule]])
os.mkdir(tmpdir)
- os.runv(verilator, argv, {envs = toolchain:runenvs()})
+ -- we just pass relative sourcefile path to solve this issue on windows.
+ -- @see https://github.com/verilator/verilator/issues/3873
+ os.runv(verilator, argv, {curdir = tmpdir, envs = toolchain:runenvs()})
-- parse some configurations from cmakefile
local verilator_root