Scala Native compilation mode (nativeMode) via command line
15 of July, 2017
Scala Native has two linking modes:
- debug (default) favours quicker compilation time to runtime, which is great for iterative development;
- release is slower at compile time, but optimises for best runtime performance.
It can just be set in
build.sbt file the usual way:
Ideally I would not like to always use the same mode, but to keep using “debug” on local dev environment and override to “release” on CI build.
Unfortunately I didn’t find a way to achieve it without a boilerplate.
Thankfully it’s not complicated task.
Example below sets “debug” as default and allows to override it via java props, when necessary.
Allow to override default compilation mode in
build.sbt via props:
Override default at compilation in CI:
Use default on dev:comments powered by Disqus