-
Notifications
You must be signed in to change notification settings - Fork 138
/
BuildWin64.bat
73 lines (64 loc) · 1.72 KB
/
BuildWin64.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@echo OFF
set SOURCE_DIR=%~dp0
set OUTPUT_DIR=build_win64
set BUILD_TYPE=Release
set BUILD_ARCH=x64
set ENABLE_EXAMPLES=ON
set ENABLE_TESTS=ON
set STATIC_LIB=OFF
set VERBOSE=0
set PROJECT_ONLY=0
REM Ensure we are inside the repository folder
if not exist "CMakeLists.txt" (
echo error: file not found: CMakeLists.txt
exit 1
)
REM Make output build folder
if not "%1" == "" (
if "%2" == "" (
set OUTPUT_DIR=%1
) else (
echo error: too many arguemnts
echo usage: BuildWin64.bat [OUTPUT_DIR]
exit 1
)
)
if not exist "%OUTPUT_DIR%" (
mkdir "%OUTPUT_DIR%"
)
REM Checkout external depenencies
set GAUSSIAN_LIB_DIR=GaussianLib\include
if exist "external\%GAUSSIAN_LIB_DIR%" (
set GAUSSIAN_LIB_DIR=external\%GAUSSIAN_LIB_DIR%
) else (
if not exist "%GAUSSIAN_LIB_DIR%" (
REM Clone third party into build folder
pushd %OUTPUT_DIR%
git clone https://github.com/LukasBanana/GaussianLib.git
popd
)
set GAUSSIAN_LIB_DIR=%OUTPUT_DIR%\%GAUSSIAN_LIB_DIR%
)
REM Print additional information if in verbose mode
if %VERBOSE% == 1 (
echo GAUSSIAN_LIB_DIR=%GAUSSIAN_LIB_DIR%
)
REM Build into output directory
set OPTIONS= ^
-DLLGL_BUILD_WRAPPER_C99=ON ^
-DLLGL_BUILD_RENDERER_OPENGL=ON ^
-DLLGL_BUILD_RENDERER_DIRECT3D11=ON ^
-DLLGL_BUILD_RENDERER_DIRECT3D12=ON ^
-DLLGL_BUILD_EXAMPLES=%ENABLE_EXAMPLES% ^
-DLLGL_BUILD_TESTS=%ENABLE_TESTS% ^
-DLLGL_BUILD_STATIC_LIB=%STATIC_LIB% ^
-DGaussLib_INCLUDE_DIR:STRING="%GAUSSIAN_LIB_DIR%" ^
-A %BUILD_ARCH% ^
-B "%OUTPUT_DIR%" ^
-S "%SOURCE_DIR%"
if %PROJECT_ONLY% == 0 (
cmake %OPTIONS%
cmake --build "%OUTPUT_DIR%" --config %BUILD_TYPE%
) else (
cmake %OPTIONS%
)