Skip to content

Commit 1dad871

Browse files
committed
build script added.
1 parent 9315c8b commit 1dad871

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

auto-setup-windows.cmd

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
@echo off
2+
goto aftercopyright
3+
4+
**
5+
** auto-setup-windows.cmd
6+
** Automatic (easy) setup and build script for Windows
7+
**
8+
** Note that this script assumes you have both 'git' and 'cmake' installed properly and in your PATH!
9+
** This script also assumes you have installed a build system that cmake can automatically detect.
10+
** Such as Visual Studio Community. Requires appropriate SDK installed too!
11+
** Without these items, this script will FAIL! So make sure you have your build environment properly
12+
** set up in order for this script to succeed.
13+
**
14+
** The purpose of this script is to get someone easily going with a full working compile of GZDoom.
15+
** This allows anyone to make simple changes or tweaks to the engine as they see fit and easily
16+
** compile their own copy without having to follow complex instructions to get it working.
17+
** Every build environment is different, and every computer system is different - this should work
18+
** in most typical systems under Windows but it may fail under certain types of systems or conditions.
19+
** Not guaranteed to work and your mileage will vary.
20+
**
21+
**---------------------------------------------------------------------------
22+
** Copyright 2023 Rachael Alexanderson and the GZDoom team
23+
** All rights reserved.
24+
**
25+
** Redistribution and use in source and binary forms, with or without
26+
** modification, are permitted provided that the following conditions
27+
** are met:
28+
**
29+
** 1. Redistributions of source code must retain the above copyright
30+
** notice, this list of conditions and the following disclaimer.
31+
** 2. Redistributions in binary form must reproduce the above copyright
32+
** notice, this list of conditions and the following disclaimer in the
33+
** documentation and/or other materials provided with the distribution.
34+
** 3. The name of the author may not be used to endorse or promote products
35+
** derived from this software without specific prior written permission.
36+
**
37+
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
38+
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39+
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
40+
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
41+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42+
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
43+
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44+
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
45+
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
46+
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47+
**---------------------------------------------------------------------------
48+
**
49+
50+
:aftercopyright
51+
52+
53+
setlocal
54+
rem -- Always operate within the build folder
55+
if not exist "%~dp0\build" mkdir "%~dp0\build"
56+
pushd "%~dp0\build"
57+
58+
if exist vcpkg if exist vcpkg\* git -C ./vcpkg pull
59+
if not exist vcpkg git clone https://github.com/microsoft/vcpkg
60+
61+
if exist zmusic if exist vcpkg\* git -C ./zmusic pull
62+
if not exist zmusic git clone https://github.com/zdoom/zmusic
63+
64+
mkdir "%~dp0\build\zmusic\build"
65+
mkdir "%~dp0\build\vcpkg_installed"
66+
67+
cmake -A x64 -S ./zmusic -B ./zmusic/build ^
68+
-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake ^
69+
-DVCPKG_LIBSNDFILE=1 ^
70+
-DVCPKG_INSTALLLED_DIR=../vcpkg_installed/
71+
cmake --build ./zmusic/build --config Release -- -maxcpucount -verbosity:minimal
72+
73+
cmake -A x64 -S .. -B . ^
74+
-DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake ^
75+
-DZMUSIC_INCLUDE_DIR=./zmusic/include ^
76+
-DZMUSIC_LIBRARIES=./zmusic/build/source/Release/zmusiclite.lib ^
77+
-DVCPKG_INSTALLLED_DIR=./vcpkg_installed/
78+
cmake --build . --config RelWithDebInfo -- -maxcpucount -verbosity:minimal
79+
80+
rem -- If successful, show the build
81+
if exist RelWithDebInfo\raze.exe explorer.exe RelWithDebInfo
82+

0 commit comments

Comments
 (0)