winimx

Winim contains too many Windows SDK definitions, so it often needs a lot of time to compile a file, especially for large project (for example, wNim).

Here is the solution. Winimx is a standalone tool to generate the minfied Winim module. This file also can be used as a nim module to generate the necessary definitions at compile time.

In general, you should add following lines at beginning of file to use winimx as a module:

import winim/[winimx, winstr, utils]
winimx(currentSourcePath())

winimx is a template here. It accepts one or multiple filenames and use system.gorge() to call winimx.exe and then generate the code. Notice, the filenames must include the full path, otherwise winimx cannot find it (There is no getAppDir() at compile time for now). Here is a technic to get the full path of source code directory:

import os
winimx currentSourcePath().parentDir() / "keywords.txt"

If Winim (version >= 3.0) is installed by nimble, the winimx.exe should be placed in the correct directory to use. In other case, you should make sure winimx.exe can be found by system.

Templates

template winimx(filenames: varargs[string])