summaryrefslogtreecommitdiff
path: root/win/build_maria_release.bat
blob: c5b1bb915c29576b6b5fbd705daca4c62a805558 (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
set build_64_bit=
set build_msi=
set generator=
set scriptdir=%~dp0

::     Process all the arguments from the command line
::
:process_arguments
  if "%~1"=="" goto :do_work
  if "%~1"=="-h" goto :help
  if "%~1"=="-msi" set build_msi=1
  if "%~1"=="-G" set generator=-G "%~2"
  shift
  goto :process_arguments

:help
 echo "build_maria_release [-h] [-msi] [-G <Generator>]" 

:die
 echo error occured.
 popd
 exit /b 1

:do_work
:: We're doing out-of-source build to ensure nobody has broken it:)
 
  pushd %scriptdir%
  cd ..
  rd /s /q xxx
  mkdir xxx
  cd xxx
  
  cmake .. -DWITH_EMBEDDED_SERVER=1 %generator%
  if %ERRORLEVEL% NEQ 0  goto :die
  cmake --build . --config Debug
  if %ERRORLEVEL% NEQ 0  goto :die
  cmake --build . --config RelWithDebInfo --target package
  if %ERRORLEVEL% NEQ 0  goto :die
  
  
  if "%build_msi%"=="1" (
    cmake --build . --config RelWithDebInfo --target win\packaging\msi
    if %ERRORLEVEL% NEQ 0  goto :die
  )
  xcopy /y *.zip  ..
  xcopy /y *.msi ..
  popd