mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-15 18:10:26 +01:00
29 lines
922 B
Nix
29 lines
922 B
Nix
{ pkgs ? import <nixpkgs> {}
|
|
, crossPkgs ? import <nixpkgs> {}
|
|
, enableLibcxx ? false # Whether to use libc++ toolchain and libraries instead of libstdc++
|
|
, minimal ? false # Whether to create minimal shell without extra tools (faster when cross compiling)
|
|
}:
|
|
|
|
let
|
|
lib = pkgs.lib;
|
|
llvm = crossPkgs.llvmPackages_20;
|
|
capnproto = crossPkgs.capnproto.override (lib.optionalAttrs enableLibcxx { clangStdenv = llvm.libcxxStdenv; });
|
|
clang = if enableLibcxx then llvm.libcxxClang else llvm.clang;
|
|
clang-tools = llvm.clang-tools.override { inherit enableLibcxx; };
|
|
in crossPkgs.mkShell {
|
|
buildInputs = [
|
|
capnproto
|
|
];
|
|
nativeBuildInputs = with pkgs; [
|
|
cmake
|
|
include-what-you-use
|
|
ninja
|
|
] ++ lib.optionals (!minimal) [
|
|
clang
|
|
clang-tools
|
|
];
|
|
|
|
# Tell IWYU where its libc++ mapping lives
|
|
IWYU_MAPPING_FILE = if enableLibcxx then "${llvm.libcxx.dev}/include/c++/v1/libcxx.imp" else null;
|
|
}
|