author | alfadur |
Thu, 22 Aug 2019 22:46:19 +0300 | |
changeset 15370 | 96254b857257 |
parent 15368 | 1a4ec45a4803 |
child 15371 | 81037b6052f4 |
permissions | -rw-r--r-- |
13944 | 1 |
@echo off |
15370
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
2 |
setlocal |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
3 |
::CONFIG START |
13944 | 4 |
::edit these variables if necessary |
15370
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
5 |
|
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
6 |
::change between "Debug" and "Release" |
15336 | 7 |
set BUILD_TYPE="Release" |
13944 | 8 |
::set if vcpkg is not on path |
9 |
set VCPKG_PATH=%VCPKG_ROOT% |
|
10 |
::set if CMake is not on path |
|
11 |
set CMAKE_PATH= |
|
12 |
::set if FPC is not on path |
|
13 |
set PASCAL_PATH= |
|
15370
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
14 |
::set to 1 if x86 to x64 cross-compiler is not enabled automatically |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
15 |
set FORCE_X64_CROSS_COMPILE= |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
16 |
::set to 1 to build the game server |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
17 |
set BUILD_SERVER= |
13944 | 18 |
|
15370
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
19 |
::CONFIG END |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
20 |
|
13944 | 21 |
:setup |
22 |
set CURRDIR="%CD%" |
|
23 |
cd %CURRDIR%\..\ |
|
24 |
||
25 |
set PATH=%PASCAL_PATH%;%VCPKG_PATH%;%CMAKE_PATH%;%PATH% |
|
26 |
||
15370
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
27 |
if "%VSCMD_ARG_TGT_ARCH%" == "x64" ( |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
28 |
set FORCE_X64_CROSS_COMPILE=1 |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
29 |
) |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
30 |
|
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
31 |
if "%FORCE_X64_CROSS_COMPILE%" NEQ "" ( |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
32 |
set CROSS_COMPILE_FLAG="-DWIN32_WIN64_CROSS_COMPILE=1" |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
33 |
) |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
34 |
|
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
35 |
if "%BUILD_SERVER%" == "" ( |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
36 |
set BUILD_SERVER_FLAG="-DNOSERVER=1" |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
37 |
) |
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
38 |
|
13944 | 39 |
echo Running cmake... |
40 |
set ERRORLEVEL= |
|
41 |
||
15370
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
42 |
cmake . -DCMAKE_TOOLCHAIN_FILE="%VCPKG_PATH%\scripts\buildsystems\vcpkg.cmake" -G"NMake Makefiles" "%CROSS_COMPILE_FLAG%" "%BUILD_SERVER_FLAG%" -DCMAKE_BUILD_TYPE="%BUILD_TYPE%" -DSDL2_BUILDING_LIBRARY=1 |
13944 | 43 |
|
44 |
if %ERRORLEVEL% NEQ 0 goto exitpoint |
|
45 |
||
46 |
echo Configuration completed successfully |
|
47 |
||
48 |
echo Building... |
|
49 |
set ERRORLEVEL= |
|
50 |
||
51 |
nmake |
|
52 |
||
53 |
if %ERRORLEVEL% NEQ 0 goto exitpoint |
|
54 |
||
55 |
echo Build completed successfully |
|
56 |
||
15336 | 57 |
nmake install |
58 |
||
13944 | 59 |
:exitpoint |
60 |
cd %CURRDIR% |
|
15370
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
61 |
|
96254b857257
update windows build to detect when a cross-compiler is necessary
alfadur
parents:
15368
diff
changeset
|
62 |
endlocal |
13944 | 63 |
pause |