Config files

crow-config.json

Each module may have an associated crow-config.json file. This is found by searching the same directory as the module; then the parent directory; and so on until one is found.

You can't configure the same module multiple ways; the config is part of the code.

The config applies to the module, not the whole program. A single compile may include modules with different configs. Type-checking each module depends only on its own config.

Some options will only matter for the main config, meaning the config for the main module. (When you run crow build foo.crow or crow run foo.crow, that makes foo.crow the main module.)

SDL example

If you haven't already, download the demos.

Library config

First, look at the config in crow-demo/libraries/SDL2/crow-config.json. This config applies to everything in libraries/SDL2.
It's pretty basic:

{ "extern": { "SDL2": null } }

This contains everything the library needs; it enables the use of the external library SDL2 without specifying where it will come from.

Main config

Now look at crow-demo/sdl/crow-config.json:

{ "include": { "SDL2": "../libraries/SDL2" }, "extern": { "SDL2": "../extern/SDL2" } }

"include" is for using Crow libraries.
It specifies where imports of SDL2 will come from. The relative path here is relative to the location of the crow-config.json file.
So, an import of SDL2/SDL_rect will import the module from libraries/SDL2/SDL_rect.

"extern" is for using external libraries. This specifies that the machine code for SDL2 will be found in the crow-demo/extern/SDL2 directory. (Since the path is relative to crow-demo/sdl/crow-config.json.)
(That directory has a .dll but not .so; on Linux, it will be searched for in system paths.)
The paths in "extern" only matter for the main config. For a library, then can be left null, but they do need to exist to enable referencing the library.

Every extern foo expression in a program will be true if the extern section of the main config has a non-null value for the key "foo", and false otherwise.