Closed greenfork closed 3 years ago
I get why you want to add this but it is a bit awful. At least add a comment explaining why this is there and then we can merge it.
I share your sentiment, this is awful. There are some alternatives I have considered:
declare.janet
.zig cc
in a script - I couldn't make that work with os/execute
, it probably expects an executable binary file as the first argument. There's an option to compile a program which passes all arguments to zig cc
- probably it is going to work but looks like even more awful thing to do compared to this pull request.(def args (mapcat |(string/split " " $) args))
- looks much less awful. Also it helps with specifying several flags in --cflags='-flto -O2'
. Otherwise compiler complains Unknown Clang option: '-flto -O2'
. But I don't know how safe it is to assume that no options contain spaces, probably there's a case where it is not safe. At the same time to my best knowledge there's no way to specify multiple flags via --cflags
.I'm not in a hurry to merge this and I'm open to suggestions. For now I added the comment you asked and feel free to merge it if you think this is good enough.
I'm pretty sure this is fine, I can't imagine any sane, informed person putting spaces in the name of a binary, but we should at least add a comment why this is being done.
Thanks!
Closes #28