-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
72 lines (63 loc) · 1.42 KB
/
build.bat
File metadata and controls
72 lines (63 loc) · 1.42 KB
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
@echo off
SET CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX=install
SET CMAKE_BUILD=Release
SET WHEEL=0
REM Parse command line
:loop
IF NOT "%1"=="" (
IF "%1"=="--help" (
GOTO :Help
) ELSE IF "%1"=="-h" (
GOTO :Help
) ELSE IF "%1"=="--debug" (
SET CMAKE_BUILD=Debug
) ELSE IF "%1"=="-d" (
SET CMAKE_BUILD=Debug
) ELSE IF "%1"=="--build-wheel" (
SET WHEEL=1
) ELSE IF "%1"=="--global" (
SET CMAKE_OPTIONS=-DLOCAL_INSTALL=OFF
) ELSE (
GOTO :Help
)
SHIFT
GOTO :loop
)
if not exist "build" (
mkdir build
)
cd build
cmake .. %CMAKE_OPTIONS%
cmake --build . --target ALL_BUILD --config %CMAKE_BUILD% -- /nologo /verbosity:minimal /maxcpucount
cmake --build . --target INSTALL --config %CMAKE_BUILD% -- /nologo /verbosity:minimal /maxcpucount
REM Build wheel if necessary
IF "%WHEEL%" == "1" (
cd install
python -c "import librir;print('librir is importable !')"
pip wheel --no-deps .
cd ..
)
cd ..
EXIT /B 0
:Help
echo "Build script for librir"
echo
echo "Usage:"
echo "--help display help"
echo "--debug debug build only (default is release only)"
echo "--build-wheel build Python wheel package"
echo "--global global installation instead of local one"
echo
EXIT /B 0
:clone_pull
REM for /F "delims=" %%i in (%~1) do set basename="%%~ni"
set basename=%~n1
echo "basename is %basename%"
if not exist "%basename%" (
git clone %~1
) else (
cd %basename%
git pull
cd ..
)
EXIT /B 0