-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-dependencies.sh
More file actions
executable file
·73 lines (59 loc) · 1.45 KB
/
Copy pathinstall-dependencies.sh
File metadata and controls
executable file
·73 lines (59 loc) · 1.45 KB
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
#!/bin/bash
set -e
sudo echo "[Running $0]"
cmd="$1"
if [ -z "$cmd" ]; then
cmd=install
fi
if which g++-11 2> /dev/null; then
compiler="g++-11"
else
compiler="g++"
fi
if [ -z "$source_dir" ]; then
if [ -d "$HOME/.local" ]; then
source_dir="$HOME/.local/sources"
else
source_dir="$HOME/apps/sources"
fi
fi
echo Set source directory to $source_dir
function install() {
user=$1
project=$2
mkdir -p $source_dir
cd $source_dir
if [ -d $project ]; then
cd $project
git pull
else
git clone "https://github.com/$user/$project.git"
cd $project
fi
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-std=c++20 -fPIE" \
-DBUILD_TESTING=OFF \
-DCMAKE_CXX_COMPILER="$compiler" \
"${@:3}"
cmake --build build -j 16
sudo cmake --install build
}
function update() {
install "${@}"
}
function uninstall() {
user=$1
project=$2
cd "$source_dir/$project"
# This needs to run on mac and I'm not sure mac has the --arg-file flag for xargs
cat build/install_manifest.txt | sudo xargs rm -f -v
cd ..
rm -rf "$project"
}
# $cmd google benchmark -DBENCHMARK_ENABLE_TESTING=OFF
$cmd catchorg Catch2
$cmd fmtlib fmt
$cmd fastfloat fast_float
$cmd codeinred tuplet
$cmd codeinred recursive-variant