commit 1a32b2e02ebabb8a421fb514d87fb0180b15ed2d parent 4fa6be5823c221c9d45734d1677174f4dd4a7c11 Author: amin <dev@aminmesbah.com> Date: Sun, 28 Apr 2019 04:53:38 +0000 Document Windows setup steps FossilOrigin-Name: 4705437c71ef269f161ffaf08ce345fc67cc76a001aea9d25fa1b12e17673dd7 Diffstat:
M | .gitignore | | | 1 | + |
A | README.md | | | 32 | ++++++++++++++++++++++++++++++++ |
M | build.bat | | | 35 | +++++++++++++++++++++++++++++------ |
3 files changed, 62 insertions(+), 6 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -1,6 +1,7 @@ *.out *.swp +lib/glfw_windows/* out/* tags diff --git a/README.md b/README.md @@ -0,0 +1,32 @@ +### Compile on Linux + +- Install clang and glfw3 with your system's package manager. +- `make run` to compile and run the release build. + + +### Compile on Windows + +- Install and set up clang. The sanest set of instructions I've found is + [here][1]. +- Download the latest 64-bit Windows pre-compiled binary package from [here][2]. +- Unzip it and copy the `include` and `lib-vc2019` folders into + `lib/glfw_windows/`. The folder structure should look like this: + +``` +lib/glfw_windows/ +|-- include +| +-- GLFW +| |-- glfw3.h +| +-- glfw3native.h ++-- lib-vc2019 + |-- glfw3.dll + |-- glfw3dll.lib + +-- glfw3.lib +``` + +- `.\build.bat && .\out\release\a-game.exe` to compile and run the release + build. + + + [1]: https://gist.github.com/InNoHurryToCode/955d63db0d79699fed63fe18eeebf17e + [2]: https://www.glfw.org/download.html diff --git a/build.bat b/build.bat @@ -1,12 +1,35 @@ @echo off -set CFLAGS=-std=c11 -nostdlib -D_CRT_SECURE_NO_WARNINGS -Ilib -I../include/glfw/include -Wall -Wextra -Wshadow -Wswitch-enum -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -set LDFLAGS=-luser32 -lgdi32 -lwinmm -lopengl32 -lshell32 +set CFLAGS= ^ + -std=c11 ^ + -nostdlib ^ + -D_CRT_SECURE_NO_WARNINGS ^ + -Ilib ^ + -Ilib/glfw_windows/include ^ + -Wall ^ + -Wextra ^ + -Wshadow ^ + -Wswitch-enum ^ + -Wno-unused-parameter ^ + -Wno-unused-function ^ + -Wno-missing-braces + +set LDFLAGS= ^ + -luser32 ^ + -lgdi32 ^ + -lwinmm ^ + -lopengl32 ^ + -lshell32 ^ + -llib/glfw_windows/lib-vc2019/glfw3.lib + set RELCFLAGS=-O2 -Os IF NOT EXIST ".\out" mkdir ".\out" IF NOT EXIST ".\out\release" mkdir ".\out\release" -clang %CFLAGS% %RELCFLAGS%^ - src\platform_windows.c^ - ..\include\glfw\lib-vc2015\glfw3.lib^ - -o .\out\release\a-game.exe %LDFLAGS% + +clang ^ + %CFLAGS% ^ + %RELCFLAGS% ^ + src\platform_windows.c ^ + -o .\out\release\a-game.exe ^ + %LDFLAGS%