forked from unicorn-engine/unicorn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nmake.bat
40 lines (31 loc) · 811 Bytes
/
nmake.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
:: Unicorn Emulator Engine
:: Build Unicorn libs on Windows with CMake & Nmake
:: Usage: nmake.bat [x86 arm aarch64 m68k mips sparc], default build all.
:: By Huitao Chen, 2019
@echo off
set flags="-DCMAKE_BUILD_TYPE=Release"
set allparams=
:loop
set str=%1
if "%str%"=="" (
goto end
)
set allparams=%allparams% %str%
shift /0
goto loop
:end
if "%allparams%"=="" (
goto eof
)
:: remove left, right blank
:intercept_left
if "%allparams:~0,1%"==" " set "allparams=%allparams:~1%" & goto intercept_left
:intercept_right
if "%allparams:~-1%"==" " set "allparams=%allparams:~0,-1%" & goto intercept_right
:eof
if "%allparams%"=="" (
cmake "%flags%" -G "NMake Makefiles" ..
) else (
cmake "%flags%" "-DUNICORN_ARCH=%allparams%" -G "NMake Makefiles" ..
)
nmake