tools/build_vcpkg.bat
changeset 15349 96254b857257
parent 15347 1a4ec45a4803
child 15350 81037b6052f4
equal deleted inserted replaced
15348:e390ef1c7a5c 15349:96254b857257
     1 @echo off
     1 @echo off
       
     2 setlocal
       
     3 ::CONFIG START
     2 ::edit these variables if necessary
     4 ::edit these variables if necessary
       
     5 
       
     6 ::change between "Debug" and "Release"
     3 set BUILD_TYPE="Release"
     7 set BUILD_TYPE="Release"
     4 ::set if vcpkg is not on path
     8 ::set if vcpkg is not on path
     5 set VCPKG_PATH=%VCPKG_ROOT%
     9 set VCPKG_PATH=%VCPKG_ROOT%
     6 ::set if CMake is not on path
    10 ::set if CMake is not on path
     7 set CMAKE_PATH=
    11 set CMAKE_PATH=
     8 ::set if FPC is not on path
    12 ::set if FPC is not on path
     9 set PASCAL_PATH=
    13 set PASCAL_PATH=
       
    14 ::set to 1 if x86 to x64 cross-compiler is not enabled automatically
       
    15 set FORCE_X64_CROSS_COMPILE=
       
    16 ::set to 1 to build the game server
       
    17 set BUILD_SERVER=
    10 
    18 
       
    19 ::CONFIG END
       
    20             
    11 :setup
    21 :setup
    12 set CURRDIR="%CD%"
    22 set CURRDIR="%CD%"
    13 cd %CURRDIR%\..\
    23 cd %CURRDIR%\..\
    14 
    24 
    15 set PATH=%PASCAL_PATH%;%VCPKG_PATH%;%CMAKE_PATH%;%PATH%
    25 set PATH=%PASCAL_PATH%;%VCPKG_PATH%;%CMAKE_PATH%;%PATH%
    16 
    26 
       
    27 if "%VSCMD_ARG_TGT_ARCH%" == "x64" (
       
    28     set FORCE_X64_CROSS_COMPILE=1
       
    29 )
       
    30 
       
    31 if "%FORCE_X64_CROSS_COMPILE%" NEQ "" (
       
    32     set CROSS_COMPILE_FLAG="-DWIN32_WIN64_CROSS_COMPILE=1"
       
    33 )
       
    34 
       
    35 if "%BUILD_SERVER%" == "" (
       
    36     set BUILD_SERVER_FLAG="-DNOSERVER=1"
       
    37 )              
       
    38 
    17 echo Running cmake...
    39 echo Running cmake...
    18 set ERRORLEVEL=
    40 set ERRORLEVEL=
    19 
    41 
    20 cmake . -DCMAKE_TOOLCHAIN_FILE="%VCPKG_PATH%\scripts\buildsystems\vcpkg.cmake" -G"NMake Makefiles" -DNOSERVER=1 -DCMAKE_BUILD_TYPE="%BUILD_TYPE%" -DSDL2_BUILDING_LIBRARY=1
    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
    21 
    43 
    22 if %ERRORLEVEL% NEQ 0 goto exitpoint
    44 if %ERRORLEVEL% NEQ 0 goto exitpoint
    23 
    45 
    24 echo Configuration completed successfully
    46 echo Configuration completed successfully
    25 
    47 
    34 
    56 
    35 nmake install
    57 nmake install
    36 
    58 
    37 :exitpoint
    59 :exitpoint
    38 cd %CURRDIR%
    60 cd %CURRDIR%
       
    61 
       
    62 endlocal
    39 pause
    63 pause