This commit sets nwn_script_comp as the default compiler and reuses the configuration options nssCompiler and nssFlags. nwn_script_comp output is read through peg and modified to appear nasher-organic.
Went a few different directions on this integration, so would appreciate feedback on the current incarnation. I've been away from nim for about six months, so I'm sure it can be written more efficiently. Flame awy.
I'd like to add a feature where the user can specify nssCompiler and nssFlags per target, or for a way to switch within the package. As I tested the various errors that nwn_script_comp provides, although generally much better than nwnsc, there are some that are much less informative. It would be handy to have a target that compiles with nwnsc when running into those specific errors where nwnsc would be a better compiler. Currently this is not possible as config opts are not overwritten by user-defined flags, but I'll look into it.
getFlags, though compiler-specific, was left in compile.nim instead of compiler.nim due to the requirement for opts and target, which cannot be included in compiler.nim without circular reference.
I've tested this against small module builds, single file compilation and various nasher commands, and it seems to work correctly. If you have nssCompiler and nssFlags set for nwnsc, nasher will not default to nwn_script_comp until you unset those options or reset nssCompiler to ../nwn_script_comp[.exe]. The nssFlags can be unset completely to allow nasher to build the option line, or can be set with flags per-target. Only tested on windows.
This commit sets
nwn_script_comp
as the default compiler and reuses the configuration optionsnssCompiler
andnssFlags
.nwn_script_comp
output is read through peg and modified to appear nasher-organic.Went a few different directions on this integration, so would appreciate feedback on the current incarnation. I've been away from nim for about six months, so I'm sure it can be written more efficiently. Flame awy.
I'd like to add a feature where the user can specify
nssCompiler
andnssFlags
per target, or for a way to switch within the package. As I tested the various errors thatnwn_script_comp
provides, although generally much better thannwnsc
, there are some that are much less informative. It would be handy to have a target that compiles withnwnsc
when running into those specific errors wherenwnsc
would be a better compiler. Currently this is not possible as config opts are not overwritten by user-defined flags, but I'll look into it.getFlags
, though compiler-specific, was left incompile.nim
instead ofcompiler.nim
due to the requirement foropts
andtarget
, which cannot be included incompiler.nim
without circular reference.I've tested this against small module builds, single file compilation and various nasher commands, and it seems to work correctly. If you have
nssCompiler
andnssFlags
set fornwnsc
,nasher
will not default tonwn_script_comp
until you unset those options or resetnssCompiler
to../nwn_script_comp[.exe]
. ThenssFlags
can be unset completely to allow nasher to build the option line, or can be set withflags
per-target. Only tested on windows.Documentation changes are still a WIP.