From 8c7de212981754731d617cbebf8ce86fa0a11975 Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Mon, 20 Feb 2023 14:42:21 +0800 Subject: [PATCH] Add build scripts for Windows Specify command for building in Windows without depending on the IDE. --- .gitignore | 1 + 00-build-cache-debug-x64.bat | 1 + 01-build-game.bat | 1 + 02-build-server.bat | 1 + README.md | 10 ++++++++++ 5 files changed, 14 insertions(+) create mode 100644 00-build-cache-debug-x64.bat create mode 100644 01-build-game.bat create mode 100644 02-build-server.bat diff --git a/.gitignore b/.gitignore index 52362bf..3d6c207 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,4 @@ assets_wip/ Backup_*.cdr .DS_Store *.sqlite +build/ diff --git a/00-build-cache-debug-x64.bat b/00-build-cache-debug-x64.bat new file mode 100644 index 0000000..8b5a26d --- /dev/null +++ b/00-build-cache-debug-x64.bat @@ -0,0 +1 @@ +cmake -DPROJECT_SOURCE_DIR=. -DCMAKE_SIZEOF_VOID_P=8 "-DCMAKE_MT=%CMAKE_MT%" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_C_FLAGS=-m64 -G Ninja -S . -B ./build/Debug diff --git a/01-build-game.bat b/01-build-game.bat new file mode 100644 index 0000000..5fbc708 --- /dev/null +++ b/01-build-game.bat @@ -0,0 +1 @@ +cmake --build build/Debug -t game diff --git a/02-build-server.bat b/02-build-server.bat new file mode 100644 index 0000000..1b678e5 --- /dev/null +++ b/02-build-server.bat @@ -0,0 +1 @@ +cmake --build build/Debug -t server diff --git a/README.md b/README.md index 253c97f..7dd2807 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,16 @@ A run-and-gun shooter inspired by Metal Slug. ### Windows +The following tools are required: + +* CMake +* Ninja +* Clang + > Set your `CC` environment variable to the full path of `clang-cl.exe` + + > Set your `CMAKE_MT` environment variable to the full path of `mt.exe`, which can be found on your Windows SDK + > installation folder (usually `C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/mt.exe`) + 1. Clone this repo. 2. Clone the repositories under `dependencies.txt` except for SDL2. 3. Unpack the **MSVC** archive under `dependencies` folder in this project's root. Rename the directory as `SDL2`.