-
Notifications
You must be signed in to change notification settings - Fork 283
/
Copy pathproduction_build.cmd
79 lines (72 loc) · 1.91 KB
/
production_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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
IF [%MEGA_VCPKGPATH%]==[] (
SET MEGA_VCPKGPATH=C:\Users\build\MEGA\build-MEGASync\3rdParty\vcpkg
)
IF [%MEGA_QTPATH%]==[] (
IF NOT [%MEGAQTPATH%]==[] (
SET MEGA_QTPATH=%MEGAQTPATH%
) ELSE (
SET MEGA_QTPATH=C:\Qt\5.15.13\x64
)
)
IF [%MEGA_CORES%]==[] (
FOR /f "tokens=2 delims==" %%f IN ('wmic cpu get NumberOfLogicalProcessors /value ^| find "="') DO SET MEGA_CORES=%%f
)
REM Clean up any previous leftovers
IF EXIST build-x64-windows-mega (
rmdir /s /q build-x64-windows-mega
)
mkdir build-x64-windows-mega
cd build-x64-windows-mega
REM Overwrite C and CXX flags. We want debug info, with O2 and Ob2 level optimization.
cmake ^
-G "Visual Studio 17 2022" ^
-A x64 ^
-DCMAKE_VERBOSE_MAKEFILE="ON" ^
-DENABLE_DESIGN_TOKENS_IMPORTER="OFF" ^
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="/Zi /O2 /Ob2 /DNDEBUG" ^
-DCMAKE_C_FLAGS_RELWITHDEBINFO="/Zi /O2 /Ob2 /DNDEBUG" ^
-DVCPKG_ROOT=%MEGA_VCPKGPATH% ^
-DCMAKE_PREFIX_PATH=%MEGA_QTPATH% ^
-S ".." ^
-B . ^
|| exit 1 /b
cmake ^
--build . ^
--config RelWithDebInfo ^
--target MEGAsync ^
--target MEGAupdater ^
--target MEGAShellExt ^
-j%MEGA_CORES% ^
|| exit 1 /b
cd ..
IF "%MEGA_SKIP_32_BIT_BUILD%" == "true" (
GOTO :EOF
)
REM Clean up any previous leftovers
IF EXIST build-x86-windows-mega (
rmdir /s /q build-x86-windows-mega
)
mkdir build-x86-windows-mega
cd build-x86-windows-mega
REM Overwrite C and CXX flags. We want debug info, with O2 and Ob2 level optimization.
cmake ^
-G "Visual Studio 17 2022" ^
-A Win32 ^
-DCMAKE_VERBOSE_MAKEFILE="ON" ^
-DENABLE_DESIGN_TOKENS_IMPORTER="OFF" ^
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="/Zi /O2 /Ob2 /DNDEBUG" ^
-DCMAKE_C_FLAGS_RELWITHDEBINFO="/Zi /O2 /Ob2 /DNDEBUG" ^
-DVCPKG_ROOT=%MEGA_VCPKGPATH% ^
-DCMAKE_PREFIX_PATH=%MEGA_QTPATH%\..\x86 ^
-S ".." ^
-B . ^
|| exit 1 /b
cmake ^
--build . ^
--config RelWithDebInfo ^
--target MEGAsync ^
--target MEGAupdater ^
--target MEGAShellExt ^
-j%MEGA_CORES% ^
|| exit 1 /b
cd ..