File: fix-building-without-cuda.patch

package info (click to toggle)
cccl 2.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 89,900 kB
  • sloc: cpp: 697,664; ansic: 26,964; python: 11,928; sh: 3,284; asm: 2,154; perl: 460; makefile: 112; xml: 13
file content (29 lines) | stat: -rw-r--r-- 1,110 bytes parent folder | download | duplicates (2)
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
Author: Andreas Beckmann <anbe@debian.org>
Description: fix building without CUDA toolkit

--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -32,6 +32,7 @@ set(cmake_cpm_opts
   -D "CCCL_TAG=${CCCL_EXAMPLE_CPM_TAG}"
 )
 
+if (CMAKE_CUDA_COMPILER)
 cccl_add_compile_test(test_name
   cccl.example
   example_project
@@ -39,3 +40,4 @@ cccl_add_compile_test(test_name
   ${cmake_opts}
   ${cmake_cpm_opts}
 )
+endif()
--- a/libcudacxx/CMakeLists.txt
+++ b/libcudacxx/CMakeLists.txt
@@ -50,7 +50,7 @@ if ("${CMAKE_CUDA_COMPILER_ID}" STREQUAL
 endif ()
 option(LIBCUDACXX_ENABLE_STATIC_LIBRARY "Enable building the full C++ stdlib static library build."
     ${_libcudacxx_enable_static_library})
-option(LIBCUDACXX_ENABLE_LIBCUDACXX_TESTS "Enable libcu++ tests." ON)
+option(LIBCUDACXX_ENABLE_LIBCUDACXX_TESTS "Enable libcu++ tests." ${LIBCUDACXX_ENABLE_CUDA})
 option(LIBCUDACXX_ENABLE_LIBCXX_TESTS "Enable upstream libc++ tests." OFF)
 option(LIBCUDACXX_ENABLE_LIBCXXABI_TESTS "Enable upstream libc++abi tests." OFF)
 option(LIBCUDACXX_ENABLE_LIBUNWIND_TESTS "Enable upstream libunwind tests." OFF)