forked from vgvassilev/clad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
30 lines (27 loc) · 961 Bytes
/
shell.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
# Declaration of an environment that can be used to build Clad and compile
# binaries with clang++ using the Clad plugin.
#
# Provided environment variables:
# - CMAKE_FLAGS : flags for configuring with CMake
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
llvmPackages_16.clang-unwrapped # for Clang library
llvmPackages_16.clangUseLLVM # for clang wrapper (useful to compile code that tests Cland)
llvmPackages_16.libcxxStdenv # standard C++ library for Clang
llvmPackages_16.stdenv # standard C library for Clang
llvm_16 # using LLVM 16, because this is also what ROOT uses
];
shellHook =
with {
cmakeFlags = [
"-DCLAD_DISABLE_TESTS=ON"
"-DLLVM_DIR=${pkgs.llvm_16.dev}"
"-DClang_DIR=${pkgs.llvmPackages_16.clang-unwrapped.dev}"
];
}; ''
CMAKE_FLAGS="${pkgs.lib.strings.concatStrings (pkgs.lib.strings.intersperse " " cmakeFlags)}"
'';
}