-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
46 lines (39 loc) · 835 Bytes
/
default.nix
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
#
# Usage:
# nix-shell --run test
#
let
pkgs = import ./nixpkgs {};
in pkgs.mkShell {
pname = "interval-map";
version = "0.1";
buildInputs = with pkgs; [
gcc13
cmake
ninja
gtest
];
shellHook = ''
build() {
rm -rf cmake-build && mkdir cmake-build && cd cmake-build
cmake -GNinja -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ..
ninja
}
test() {
build
./tests
cd ..
}
help() {
echo ""
echo "Welcome to the interval map implementation by Robert Richter🚀 !"
echo ""
echo "Following commands are available:"
echo " - run: Build and run the solution."
echo " - test: Run the tests."
echo " - build: Build the solution."
echo " - help: Show this help message."
}
help
'';
}