This is a copy of the SDL source code with the premake build system added. It was loosely based on the premake4 build system for SDL written by renpy, however I have only learned premake5 and almost all of that knowledge is not applicable to premake4.
The official source release of SDL can be found here.
So far, the premake files I have written only support Windows. As such I have only included the batch files for building on Windows. I will add support for Linux and MacOS if and when I need it or if there is sufficient demand.
To build the solution and project files for SDL2:
- Install Git (or Github Desktop if you prefer)
and clone the repository in the command prompt with
git clone https://github.com/SpookyScaryStudios/SDL2 target/directory
- Run
GenerateProjectFiles.bat
and open theSDL.sln
file in the root directory.
To link SDL2 to another project:
- Clone the repository into your project as a git submodule in the command prompt with
git submodule add https://github.com/SpookyScaryStudios/SDL2 target/directory
- Include
SDL2.lua
andSDL2main.lua
into your project's premake file. These can be found in theBuild
directory, in folders of the same name.
The project has a directary structure similar to that of Unreal Engine:
Directory | Description |
---|---|
Binaries | Binary directory. |
Build | Where premake files, batch files and binaries are stored. |
docs | SDL documentation (copied from the SDL source). |
include | SDL include path (copied from the SDL source). |
Intermediate | Intermediates and project files. |
src | SDL source code (copied from the SDL source). |
Please feel free to contribute to this repository by reporting errors or even submitting pull requests. I really appreciate it if you do, and will try to resolve the issue or merge the pull request as soon as possible.
This project is licenced under the zlib licence, since it is a modified version of SDL2.