about summary refs log tree commit diff
path: root/pkgs/development/compilers/cudatoolkit/stdenv.nix
blob: 95e783a682bffb5e1e695e07644a701d1ca8de25 (plain) (blame)
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
{ lib
, nixpkgsCompatibleLibstdcxx
, nvccCompatibleCC
, overrideCC
, stdenv
, wrapCCWith
}:

let
  cc = wrapCCWith
    {
      cc = nvccCompatibleCC;

      # This option is for clang's libcxx, but we (ab)use it for gcc's libstdc++.
      # Note that libstdc++ maintains forward-compatibility: if we load a newer
      # libstdc++ into the process, we can still use libraries built against an
      # older libstdc++. This, in practice, means that we should use libstdc++ from
      # the same stdenv that the rest of nixpkgs uses.
      # We currently do not try to support anything other than gcc and linux.
      libcxx = nixpkgsCompatibleLibstdcxx;
    };
  cudaStdenv = overrideCC stdenv cc;
  passthruExtra = {
    inherit nixpkgsCompatibleLibstdcxx;
    # cc already exposed
  };
  assertCondition = true;
in
lib.extendDerivation
  assertCondition
  passthruExtra
  cudaStdenv