about summary refs log tree commit diff
path: root/pkgs/test
diff options
context:
space:
mode:
authorConnor Baker <connor.baker@tweag.io>2023-11-07 20:22:58 +0000
committerConnor Baker <connor.baker@tweag.io>2023-11-07 20:22:58 +0000
commitb807a32c2cb972b1f19c3282116b71ab43dd32f4 (patch)
treef56a8ca59d18b99a91735bc80ce00bf31674b95b /pkgs/test
parent30be50b0809c93314b41f448dbdb8400502be54b (diff)
cudaPackages.cuda-samples: fix CMake build error on 12.2+
Diffstat (limited to 'pkgs/test')
-rw-r--r--pkgs/test/cuda/cuda-samples/generic.nix16
1 files changed, 15 insertions, 1 deletions
diff --git a/pkgs/test/cuda/cuda-samples/generic.nix b/pkgs/test/cuda/cuda-samples/generic.nix
index 94d96fc4f1aa6..e88d7b0c31591 100644
--- a/pkgs/test/cuda/cuda-samples/generic.nix
+++ b/pkgs/test/cuda/cuda-samples/generic.nix
@@ -1,5 +1,6 @@
 { lib
 , backendStdenv
+, cmake
 , fetchFromGitHub
 , fetchpatch
 , autoAddOpenGLRunpathHook
@@ -21,7 +22,20 @@ backendStdenv.mkDerivation (finalAttrs: {
     inherit sha256;
   };
 
-  nativeBuildInputs = [ pkg-config autoAddOpenGLRunpathHook glfw3 freeimage ];
+  nativeBuildInputs = [
+    pkg-config
+    autoAddOpenGLRunpathHook
+    glfw3
+    freeimage
+  ]
+  # CMake has to run as a native, build-time dependency for libNVVM samples.
+  ++ lib.lists.optionals (lib.strings.versionAtLeast finalAttrs.version "12.2") [
+    cmake
+  ];
+
+  # CMake is not the primary build tool -- that's still make.
+  # As such, we disable CMake's build system.
+  dontUseCmakeConfigure = true;
 
   buildInputs = [ cudatoolkit ];