This will allow to pre-bundle the zig compiler together with the omni executable, without the need from the user to rely on external compilers. Moreover, zig cc is more convenient for cross-platform compilation, and, perhaps, WebAssembly too.
-fstrict-aliasing is faster than the conservative -fno-strict-aliasing that the gcc nim compiler uses by default.
This will allow to pre-bundle the zig compiler together with the omni executable, without the need from the user to rely on external compilers. Moreover,
zig cc
is more convenient for cross-platform compilation, and, perhaps, WebAssembly too.-fstrict-aliasing
is faster than the conservative-fno-strict-aliasing
that thegcc
nim compiler uses by default.Flags:
--cc:env
--passC:'-O3 -fPIC -flto -fstrict-aliasing -fno-ident'
--passL:'-flto'
Shared lib works out of the box.
For static libs, compile with
--noLinking
.Static lib can then be built manually withar
. It is installed by default on Unix.On Windows, the mingw64 version of
ar
can be used. Builds can be downloaded from: https://nim-lang.org/install_windows.html OR http://winlibs.com/EDIT:
zig ar
can easily be used instead!Check https://github.com/vitreo12/ZigAsNimCCompiler for some more instructions