-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
68 lines (51 loc) · 1.39 KB
/
build.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
@echo off
setlocal
if not exist "build" mkdir build
pushd build
set compile_type="debug"
if "%1"=="debug" set compile_type="debug"
if "%1"=="release" set compile_type="release"
if %compile_type%=="release" goto ReleaseConfig
if %compile_type%=="debug" goto DebugConfig
:DebugConfig
echo -------------------------------------
echo Debug Build configured
echo -------------------------------------
set BUILD_TYPE=Debug
goto CompilerConfig
:ReleaseConfig
echo -------------------------------------
echo Release Build configured
echo -------------------------------------
set BUILD_TYPE=Release
goto CompilerConfig
:CompilerConfig
where cl >nul 2>nul
if %ERRORLEVEL% neq 0 goto ClangConfig
set C_COMPILER=cl
set CXX_COMPILER=cl
goto Compile
:ClangConfig
where clang >nul 2>nul
if %ERRORLEVEL% neq 0 goto CompilerConfigError
set C_COMPILER=clang
set CXX_COMPILER=clang++
goto Compile
:Compile
echo Build Type=%BUILD_TYPE%
echo C_COMPILER=%C_COMPILER%
echo CXX_COMPILER=%CXX_COMPILER%
cmake -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_C_COMPILER=%C_COMPILER% -DCMAKE_CXX_COMPILER=%CXX_COMPILER% -B./ -G"Unix Makefiles" ../
make
if %ERRORLEVEL% NEQ 0 goto CompileError
goto Run
:Run
NewtonFractal.exe
goto Done
:CompileError
echo Compilation Failed
goto Done
:CompilerConfigError
echo Either install clang or run from developer command prompt
:Done
popd