-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·42 lines (33 loc) · 794 Bytes
/
bootstrap
File metadata and controls
executable file
·42 lines (33 loc) · 794 Bytes
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
#!/bin/bash
run_cmake()
{
if hash cmake3 2>/dev/null; then
cmake3 "$@"
else
cmake "$@"
fi
}
remove_cmake_files()
{
rm -rf CMakeCache.txt
rm -rf CMakeFiles
rm -rf CMakeScripts
rm -rf Makefile
rm -rf cmake_install.cmake
rm -rf install_manifest.txt
rm -rf CTestTestfile.cmake
}
bootstrap()
{
local variant=$1; shift
echo "[ Generating ${variant} makefiles ]"
mkdir -p .build/${variant}
pushd .build/${variant} > /dev/null
# remove any cached cmake variables that may exist, so we bootstrap a fresh environment
remove_cmake_files
# generate the build system
run_cmake -Dbuild=${variant} -DCMAKE_EXPORT_COMPILE_COMMANDS=1 "$@" ../..
popd > /dev/null
}
bootstrap debug "$@"
bootstrap release "$@"