-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cmd
executable file
·59 lines (52 loc) · 1.54 KB
/
build.cmd
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
::!%windir%\System32\cmd.exe
@ECHO OFF
SET processorCount=%NUMBER_OF_PROCESSORS%
FOR %%m IN (Debug Release) DO (
REM Delete existing CMake intermediate directory
REM
REM CMake doesn't support anything but a full rebuild unless you manually
REM enter each and every source file into your CMakeLists.txt. See the
REM documentation on file(GLOB_RECURSE ...) for that turd.
REM
IF "%1"=="full" (
IF EXIST obj\cmake-%%m rd /s /q obj\cmake-%%m
)
REM Let CMake build a Makefile (that's the default)
REM
REM Up until Visual Studio 2019, CMake used different generators to switch
REM between 32-bit and 64-bit (and defaults to 32-bits). Unless we want to
REM drop support for Visual Studio 2017, this variable is the only way
REM where CMake still picks up *any* installed Visual Studio version and does
REM a 64-bit build.
REM
IF "%1"=="ninja" (
cmake ^
-B obj\cmake-%%m ^
-D CMAKE_BUILD_TYPE=%%m ^
-D BUILD_UNIT_TESTS=ON ^
-D BUILD_BENCHMARK=ON ^
-D WANT_OPUS=ON ^
-D WANT_WAVPACK=ON ^
-D WANT_FLAC=ON ^
-GNinja
) ELSE (
cmake ^
-B obj\cmake-%%m ^
-D CMAKE_BUILD_TYPE=%%m ^
-D CMAKE_GENERATOR_AUDIO=x64 ^
-D BUILD_UNIT_TESTS=ON ^
-D BUILD_BENCHMARK=ON ^
-D WANT_OPUS=ON ^
-D WANT_WAVPACK=ON ^
-D WANT_FLAC=ON
)
REM Compile the binary
cmake ^
--build obj\cmake-%%m ^
--config %%m ^
--parallel %processorCount%
REM Put build artifacts in ./bin/windows-msvc14.1-amd64-release/ or similar
cmake ^
--install obj\cmake-%%m ^
--config %%m
)