From a60daf3afe5ff63509db5f839e56280d226ae612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 13 Sep 2023 19:07:01 +0200 Subject: [PATCH] Pass on -DSUITESPARSE_CUDA to projects linking to GraphBLAS_CUDA --- GraphBLAS/CMakeLists.txt | 1 - GraphBLAS/CUDA/CMakeLists.txt | 2 ++ GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index c74e83814..a77fbf583 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -61,7 +61,6 @@ endif ( ) if ( SUITESPARSE_CUDA ) # with CUDA and RMM - set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSUITESPARSE_CUDA" ) add_subdirectory ( CUDA ) set ( GB_CUDA GraphBLAS_CUDA ${CUDA_LIBRARIES} ) set ( GB_RMM rmm_wrap ${CUDA_LIBRARIES} ) diff --git a/GraphBLAS/CUDA/CMakeLists.txt b/GraphBLAS/CUDA/CMakeLists.txt index 857c1eeba..bdff4f786 100644 --- a/GraphBLAS/CUDA/CMakeLists.txt +++ b/GraphBLAS/CUDA/CMakeLists.txt @@ -73,6 +73,8 @@ set_target_properties(GraphBLAS_CUDA PROPERTIES CUDA_ARCHITECTURES "52;75;80" ) target_link_libraries(GraphBLAS_CUDA CUDA::nvrtc CUDA::cudart_static CUDA::cuda_driver CUDA::nvToolsExt ) +target_compile_definitions ( GraphBLAS_CUDA PUBLIC "SUITESPARSE_CUDA" ) + target_include_directories ( GraphBLAS_CUDA INTERFACE $ $ ) diff --git a/GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in b/GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in index 8db3b3a7e..4d2fa6a5d 100644 --- a/GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in +++ b/GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in @@ -14,4 +14,4 @@ URL: https://github.com/DrTimothyAldenDavis/SuiteSparse Description: CUDA support library for GraphBLAS in SuiteSparse Version: @GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@.@GraphBLAS_VERSION_SUB@ Libs: -L${libdir} -lgraphblascuda -Cflags: -I${includedir} +Cflags: -I${includedir} -DSUITESPARSE_CUDA