# Sumatra PDF is a PDF, ePub, MOBI, CHM, XPS, DjVu, CBZ, CBR reader for Windows

Our build system uses Premake5. For convenience, we store the binary in `bin` directory.
Premake generates Visual Studio solution in directory `vs2019` from `premake5.lua` file. Generated solution files are stored in the repository for convenience.

## Running

Premake re-generates solution files from `premake5.*.lua` files.
You only need to do that if you add or remove source files.
To re-generate:

- install Go
- make changes to `premake5.*.lua` files, most likely `premake5.files.lua`
- run `doit.bat -premake` which runs a Go program in `do` directory with `-premake` flag

## Customizing build

Sometimes we want to customize the build with `#ifdef`. We could do it by adding additional configurations, but that can spiral out of control quickly.
Instead we have `src\utils\BuildConfig.h` file. It's empty by default but you can changed it to add your `#define` customization.

## Build variants

We have `Debug`, `Release` and `ReleaseAnalyze` configurations. `ReleaseAnalyze` runs code analysis.
We have platforms:

- `Win32` : 32-bit build
- `x64` : 64-bit build
- `x32_xp` : 32-bit build for Windows XP. It requires a different compiler toolchain
- `x32_asan` : 32-build with additional runtime Address Sanitizers checks. Only available in 32-bit build because of compiler limitations

## How official builds are made

I use a Go program in `do` directory, executed with `doiit.bat -build-pre-rel` or `doit.bat -build-rel`.
I use Go program `tools\build\main.go.` You can read it for details of operation.

suggest change to this page