Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
before this PR, commands like
nim doc -b:cpp
didn't work when the backend (eg cpp) required adjustments (such asconf.exc = excCpp
), as was noticed in #14349)this PR fixes that and other issues with
--backend
:nim $cmd --backend:$backend
now works reliably by splitting the backend handling logic intocustomizeForBackend
(called for all commands) vscompileToBackend
(only called for commands that compile to a backend);nim c -b:cpp main
doesn't work timotheecour/Nim#175:--backend
can safely override previous options so that for egnim c -b:cpp main
andnim c -b:js -b:cpp main
end with with cpp backend selected, and so that defined(c) and defined(js) would be false (no-side-effect rule)parsing the flag
--backend
has by design zero side effect beyond settingconf.backend
, so that it can be overridden in subsequent flags and plays well with other commandsnim doc --backend:js
,nim doc --doccmd:-d:foo
,nim r --backend:js
,--doccmd:skip
+ other improvements #14278, made it up to date)see tests
CI failure unrelated (#13166)re-ran