forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.bat
57 lines (48 loc) · 1.19 KB
/
meson.bat
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
@ECHO OFF
SET BACKEND=ninja
SET REGEN=
SET RELEASE=
SET BUILDDIR=build
:PARSEARGS
IF NOT "%1"=="" (
IF "%1"=="-p" (
SET BACKEND=vs2015
)
IF "%1"=="-p2" (
SET BACKEND=vs2017
)
IF "%1"=="-r" (
SET REGEN=1
)
IF "%1"=="--release" (
SET RELEASE=--buildtype=release
)
SHIFT
GOTO PARSEARGS
)
IF EXIST shlr\capstone GOTO START
ECHO [ R2 MESON CLONING CAPSTONE ]
git clone -b next --depth 10 http://github.com/aquynh/capstone.git shlr\capstone
cd shlr\capstone
rem FOR /r %%p IN (..\capstone-patches\*) DO git apply %%p
git apply ..\capstone-patches\add-mips2.patch
cd ..\..
:START
IF NOT "%RELEASE%"=="" ECHO [ R2 MESON BUILD: RELEASE ]
IF "%REGEN%"=="1" GOTO REBUILD
IF NOT "%BACKEND%"=="ninja" GOTO BUILDPROJECT
IF EXIST %BUILDDIR% GOTO BUILD
python meson.py --prefix=%CD% %BUILDDIR% %RELEASE%
:BUILD
ECHO [ R2 MESON NINJA BUILD ]
copy shlr\spp\config.def.h shlr\spp\config.h
ninja -C %BUILDDIR%
exit /b %errorlevel%
:BUILDPROJECT
ECHO [ R2 MESON BUILDING %BACKEND% SLN]
IF EXIST %BUILDDIR% rd /s /q %BUILDDIR%
python meson.py --prefix=%CD% %BUILDDIR% --backend=%BACKEND% %RELEASE%
GOTO EXIT
:REBUILD
python.exe meson.py --internal regenerate %CD% "%CD%\%BUILDDIR%" --backend %BACKEND% %RELEASE%
:EXIT