Skip to content

Commit

Permalink
Set CUDA_RUNTIME_LIBRARY to documented case style (#641)
Browse files Browse the repository at this point in the history
Authors:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)

URL: #641
  • Loading branch information
KyleFromNVIDIA authored Jul 8, 2024
1 parent 02a9790 commit 4e0385b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions rapids-cmake/cuda/set_runtime.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,10 +62,10 @@ function(rapids_cuda_set_runtime target use_static value)
endif()

if(${value})
set_target_properties(${target} PROPERTIES CUDA_RUNTIME_LIBRARY STATIC)
set_target_properties(${target} PROPERTIES CUDA_RUNTIME_LIBRARY Static)
target_link_libraries(${target} ${mode} $<TARGET_NAME_IF_EXISTS:CUDA::cudart_static>)
else()
set_target_properties(${target} PROPERTIES CUDA_RUNTIME_LIBRARY SHARED)
set_target_properties(${target} PROPERTIES CUDA_RUNTIME_LIBRARY Shared)
target_link_libraries(${target} ${mode} $<TARGET_NAME_IF_EXISTS:CUDA::cudart>)
endif()

Expand Down
6 changes: 3 additions & 3 deletions testing/cuda/set_runtime-shared.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,11 +21,11 @@ rapids_cuda_set_runtime(uses_cuda USE_STATIC FALSE)


get_target_property(runtime_state uses_cuda CUDA_RUNTIME_LIBRARY)
if( NOT runtime_state STREQUAL "SHARED")
if( NOT runtime_state STREQUAL "Shared")
message(FATAL_ERROR "rapids_cuda_set_runtime didn't correctly set CUDA_RUNTIME_LIBRARY")
endif()

get_target_property(linked_libs uses_cuda LINK_LIBRARIES)
if(NOT "$<TARGET_NAME_IF_EXISTS:CUDA::cudart>" IN_LIST linked_libs)
message(FATAL_ERROR "rapids_cuda_set_runtime didn't privately link to CUDA::cudart_static")
message(FATAL_ERROR "rapids_cuda_set_runtime didn't privately link to CUDA::cudart")
endif()
4 changes: 2 additions & 2 deletions testing/cuda/set_runtime-static.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@ add_library(uses_cuda SHARED ${CMAKE_CURRENT_BINARY_DIR}/empty.cpp)
rapids_cuda_set_runtime(uses_cuda USE_STATIC TRUE)

get_target_property(runtime_state uses_cuda CUDA_RUNTIME_LIBRARY)
if( NOT runtime_state STREQUAL "STATIC")
if( NOT runtime_state STREQUAL "Static")
message(FATAL_ERROR "rapids_cuda_set_runtime didn't correctly set CUDA_RUNTIME_LIBRARY")
endif()

Expand Down

0 comments on commit 4e0385b

Please sign in to comment.