| 1 | |
| 2 | # Building OpenJazz |
| 3 | |
| 4 | Needed: |
| 5 | - SDL 3.4, 2 or SDL 1.2 (deprecated) library (https://libsdl.org/) |
| 6 | |
| 7 | Optional: |
| 8 | - SDL_net library (https://www.libsdl.org/projects/SDL_net/) |
| 9 | - CMake (https://cmake.org/) |
| 10 | |
| 11 | OpenJazz traditionally ships a basic Makefile that may be used. It is usually |
| 12 | enough to simply run `make` on UNIX-like platforms. |
| 13 | However, the old SDL 1.2 library will be used then. |
| 14 | |
| 15 | For more sophisticated building, a CMake script is provided: |
| 16 | |
| 17 | cmake -B OJ -S . |
| 18 | cmake --build OJ |
| 19 | |
| 20 | The optional installation step (`cmake --install OJ`) is not needed for all |
| 21 | platforms, but usually for UNIX-like. For Homebrew targets a packaging step is |
| 22 | also provided (`cmake --build OJ --target package`), which automatically creates |
| 23 | ZIP archives. CMake will use the SDL library version 2 by default, but can also |
| 24 | build against version 3. |
| 25 | |
| 26 | For network play, you need a platform which natively provides sockets or use |
| 27 | `SDL_net`, this is detected by CMake. You can always use `-DNETWORK=OFF` to |
| 28 | disable it. |
| 29 | On the Windows platform, the socket library (`-lws2_32`) is needed for linking |
| 30 | the executable, others might need also additional libraries. |
| 31 | If you need help porting OpenJazz to a new platform, you can always ask by email |
| 32 | or opening an issue (see README.md for details). |
| 33 | |
| 34 | ## additional build options |
| 35 | |
| 36 | - `SDL_VERSION` - SDL library version to use (2=default or 3) |
| 37 | - `DATAPATH` - add a fixed path for game data files |
| 38 | - `SCALE` - enable scaling of the video output (i.e. Scale2X...) |
| 39 | - `PORTABLE` - Do not use external directories for configuration saving, etc. |
| 40 | (This only affects Unix platforms, Windows version is always portable) |
| 41 | |
| 42 | Some ports have their own options, see [Platforms](PLATFORMS.md) for details. |
| 43 | |
| 44 | ### advanced options |
| 45 | |
| 46 | - `FULLSCREEN_ONLY` - disable window mode, useful for console ports |