-
-
Notifications
You must be signed in to change notification settings - Fork 917
Closed
Description
Xmake Version
v3.0.6+20260104
Operating System Version and Architecture
Linux archlinux 6.18.5-2-cachyos
Describe Bug
I noticed that add_values seems to deduplicate the values passed to it, which can cause problems in some cases.
For example, when using Verilator, according to #3944, I need to pass flags like this:
add_values("verilator.flags", "--x-assign", "fast", "--x-initial", "fast")However, the final command I get is:
/usr/bin/verilator ... --x-assign fast --x-initial src/hello.v
which results in the following error:
%Error: Unknown setting for --x-initial: 'src/hello.v'In contrast, when I use
add_values("verilator.flags", "--x-assign", "unique", "--x-initial", "fast")I get the correct command:
/usr/bin/verilator ... --x-assign unique --x-initial fast src/hello.vExpected Behavior
For the first example above, the resulting command should be:
/usr/bin/verilator ... --x-assign fast --x-initial fast src/hello.vProject Configuration
target("hello")
add_rules("verilator.binary")
set_toolchains("@verilator")
add_files("src/*.v")
add_files("src/*.cpp")
add_values("verilator.flags", "--x-assign", "fast", "--x-initial", "fast")Additional Information and Error Logs
$ xmake build --verbose
checking for platform ... linux
checking for architecture ... x86_64
checking for gcc ... /usr/bin/gcc
checking for nim ... no
checking for verilator ... /usr/bin/verilator
checking for verilator ... verilator
[ 0%]: compiling.verilog src/main.v
/usr/bin/verilator --cc --make cmake --prefix hello --Mdir build/.gens/hello/linux/x86_64/release/rules/verilator --x-assign fast --x-initial src/main.v
%Error: Unknown setting for --x-initial: 'src/main.v'
... Suggest '0', 'fast', or 'unique'
... See the manual at https://verilator.org/verilator_doc.html?v=5.040 for more assistance.
%Error: verilator: No Input Verilog file specified on command line, see verilator --help for more information
... This fatal error may be caused by the earlier error(s); resolve those first.
error: execv(/usr/bin/verilator --cc --make cmake --prefix hello --Mdir build/.gens/hello/linux/x86_64/release/rules/verilator --x-assign fast --x-initial src/main.v) failed(1)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done