-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·50 lines (41 loc) · 907 Bytes
/
bootstrap.sh
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
#!/bin/bash
set -euo
set -x #debug mode
BUILD_DIR_NATIVE="build_native"
if [ ! -d $BUILD_DIR_NATIVE ]
then
mkdir -p $BUILD_DIR_NATIVE
fi
pushd $BUILD_DIR_NATIVE
cmake ..
popd
# Generate clang_complete file
CLANG_COMPLETE_DIR="tmp_clang_complete"
if [ ! -d $CLANG_COMPLETE_DIR ]
then
rm -rf $CLANG_COMPLETE_DIR
fi
mkdir -p $CLANG_COMPLETE_DIR
pushd $CLANG_COMPLETE_DIR
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
mv compile_commands.json ..
rm -rf ./*
CCARGS=$HOME/.vim/bundle/clang_complete/bin/cc_args.py
chmod a+x $CCARGS
CXX="$CCARGS clang++" cmake ..
make
mv .clang_complete ..
popd
rm -rf $CLANG_COMPLETE_DIR
BUILD_DIR_EM="build_em"
if [ ! -d $BUILD_DIR_EM ]
then
mkdir -p $BUILD_DIR_EM
fi
if [ -z "${EMSCRIPTEN-}" ]
then
source ../../DevTools/emsdk/emsdk_env.sh
fi
pushd $BUILD_DIR_EM
cmake -DCMAKE_TOOLCHAIN_FILE=$EMSCRIPTEN/cmake/Modules/Platform/Emscripten.cmake ..
popd