nimble build --verbose --mm:refc -d:beast -d:release \
--cc:clang --clang.exe:zigcc --clang.linkerexe:zigcc \
--passC="--target x86_64-linux-musl" --passL="--target x86_64-linux-musl"
Error: arguments can only be given if the '--run' option is selected
nimble.nim(229) buildFromDir
use nimble c <filename> or you can create separate build task in your nimble file:
task zigcc, "Build with a zig compiler.":
let nimCmd = """nim c --verbose -d:release --cc:clang --clang.exe:zigcc --clang.linkerexe:zigcc --passC="--target x86_64-linux-musl" --passL="--target x86_64-linux-musl" main.nim"""
exec nimCmd
and use it like this:
nimble zigcc
This is likely an issue with preserving quotes. Nimble passes extra arguments as is but will lose the quotes when it reads the parameters. So when it passes it to the compiler it's actually passing --passC=-target x86-linux-musl --passL=-target x86-linux-musl
So with that in mind another option is to add more quotes (also I think it should be -target not --target):
nimble build --verbose -d:release \
--cc:clang --clang.exe:zigcc --clang.linkerexe:zigcc \
--passC="'-target x86_64-linux-musl'" --passL="'-target x86_64-linux-musl'"
Thanks, it works great 😊
nimble provides useless error messages btw 🤣
Thanks, it works great 😊
nimble provides useless error messages btw 🤣