Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding option to allow spdlog to be compiled. #1232

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ else()
target_link_libraries(rmm INTERFACE CUDA::cudart)
endif()

message(STATUS "RMM: Using header-only SPDLOG: ${RMM_HEADER_ONLY_SPDLOG}")

target_link_libraries(rmm INTERFACE rmm::Thrust)
target_link_libraries(rmm INTERFACE fmt::fmt-header-only)
target_link_libraries(rmm INTERFACE spdlog::spdlog_header_only)
target_link_libraries(rmm INTERFACE dl)
target_compile_features(rmm INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)

Expand Down Expand Up @@ -137,6 +137,10 @@ set(code_string
if(NOT TARGET rmm::Thrust)
thrust_create_target(rmm::Thrust FROM_OPTIONS)
endif()

option(RMM_HEADER_ONLY_SPDLOG "Use spdlog header-only library. Compiled version is used otherwise" ON)
mark_as_advanced(RMM_HEADER_ONLY_SPDLOG)
target_link_libraries(rmm::rmm INTERFACE $<IF:$<BOOL:${RMM_HEADER_ONLY_SPDLOG}>,spdlog::spdlog_header_only,spdlog::spdlog>)
]=])

rapids_export(
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function(ConfigureBench BENCH_NAME)
RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${RMM_BINARY_DIR}/gbenchmarks>"
CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}"
INSTALL_RPATH "\$ORIGIN/../../../lib")
target_link_libraries(${BENCH_NAME} benchmark::benchmark pthread rmm)
target_link_libraries(${BENCH_NAME} benchmark::benchmark pthread rmm spdlog::spdlog)
target_compile_definitions(${BENCH_NAME}
PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")

Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function(ConfigureTestInternal TEST_NAME)
add_executable(${TEST_NAME} ${ARGN})
target_include_directories(${TEST_NAME} PRIVATE "$<BUILD_INTERFACE:${RMM_SOURCE_DIR}>")
target_link_libraries(${TEST_NAME} GTest::gmock GTest::gtest GTest::gmock_main GTest::gtest_main
pthread rmm)
pthread rmm spdlog::spdlog)
set_target_properties(
${TEST_NAME}
PROPERTIES POSITION_INDEPENDENT_CODE ON
Expand Down