blob: d9e2eb03aed97139a859c8cfc40c9c3d93c0622f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
:: Copyright 2020 The Mumble Developers. All rights reserved.
:: Use of this source code is governed by a BSD-style license
:: that can be found in the LICENSE file at the root of the
:: Mumble source tree or at <https://www.mumble.info/LICENSE>.
::
:: Builds Mumble using the specified build script.
:: The path to the script is relative to the build environment's root.
:: The configuration we build with is adjusted to be close to
:: our release builds.
::
:: Below is a list of configuration variables used from environment.
::
:: Predefined variables:
::
:: BUILD_BINARIESDIRECTORY - The local path on the agent that can be used
:: as an output folder for compiled binaries.
:: BUILD_SOURCESDIRECTORY - The local path on the agent where the
:: repository is downloaded.
:: AGENT_TOOLSDIRECTORY - The directory used by tasks such as
:: Node Tool Installer and Use Python Version
:: to switch between multiple versions of a tool.
:: We store our build environment there, in the
:: folder specified by MUMBLE_ENVIRONMENT_DIR.
::
:: Defined in .azure-pipelines.yml:
::
:: MUMBLE_ENVIRONMENT_STORE - Path to the folder the build environment is stored in.
:: MUMBLE_ENVIRONMENT_SOURCE - Build environment web source folder URL
:: MUMBLE_ENVIRONMENT_VERSION - Full build environment version
:: Must match archive and extracted folder name.
:: MUMBLE_ENVIRONMENT_TOOLCHAIN - Path to the vcpkg CMake toolchain, used for CMake.
::
@echo on
for /f "tokens=* USEBACKQ" %%g in (`python "scripts/mumble-version.py"`) do (SET "VER=%%g")
cd /d %BUILD_BINARIESDIRECTORY%
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
:: Delete MinGW, otherwise CMake picks it over MSVC.
:: We don't delete the (Chocolatey) packages because it takes ~10 minutes...
del C:\ProgramData\chocolatey\bin\gcc.exe
del C:\ProgramData\chocolatey\bin\g++.exe
del C:\ProgramData\chocolatey\bin\c++.exe
del C:\Strawberry\c\bin\gcc.exe
del C:\Strawberry\c\bin\g++.exe
del C:\Strawberry\c\bin\c++.exe
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="%MUMBLE_ENVIRONMENT_TOOLCHAIN%" -DVCPKG_TARGET_TRIPLET=x64-windows-static-md -DIce_HOME="%MUMBLE_ENVIRONMENT_PATH%\installed\x64-windows-static-md" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -Dversion=%VER% -Dpackaging=ON -Dstatic=ON -Dsymbols=ON -Dasio=ON -Dg15=ON "%BUILD_SOURCESDIRECTORY%"
if errorlevel 1 (
exit /b %errorlevel%
)
cmake --build .
if errorlevel 1 (
exit /b %errorlevel%
)
ctest
if errorlevel 1 (
exit /b %errorlevel%
)
cmake --install .
if errorlevel 1 (
exit /b %errorlevel%
)
|