-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.envrc
40 lines (32 loc) · 1.08 KB
/
.envrc
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
# .envrc is the configuration file for direnv.
# direnv is an environment switcher for the shell.
# It knows how to hook into bash, zsh, tcsh and fish shell
# to load or unload environment variables depending on the current directory.
# This allows project-specific environment variables without cluttering the ~/.profile file.
export ROOTDIR=$(pwd)
export CC=$(which clang)
export CXX=$(which clang++)
layout python python3.6
if ! pip freeze | grep "bumpversion" &> /dev/null; then
pip install bumpversion
fi
if [ ! -d build ]; then
mkdir build
fi
cd ./build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
cd -
precommit=$ROOTDIR/.git/hooks/pre-commit
if [ ! -L $precommit ]; then
if [ -e $precommit ]; then
echo "a git pre-commit hook already exists, can't set custom one."
else
git config hooks.clangformat.style google
ln -s $ROOTDIR/tools/git-hooks/pre-commit $precommit
fi
fi
export PATH=$ROOTDIR/tools:$PATH
watch_file $ROOTDIR/build/build.ninja
watch_file $ROOTDIR/build/Makefile
watch_file $ROOTDIR/CMakeLists.txt
watch_file $ROOTDIR/.git/hooks/pre-commit