Skip to content

Commit

Permalink
Download spdlog with all the right settings
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Jan 7, 2025
1 parent ab8cd16 commit 179ce6e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions rapids-cmake/cpm/rapids_logger.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@ Result Functions
function(rapids_cpm_rapids_logger)
list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.rapids_logger")

# TODO: Need to also support this in exported config files so that header-only libraries like rmm
# can force their consumers to clone spdlog when a pre-built package is found.
if(RAPIDS_LOGGER_HIDE_ALL_SPDLOG_SYMBOLS)
get_property(_already_downloaded_spdlog GLOBAL PROPERTY RAPIDS_LOGGER_DOWNLOADED_SPDLOG)
if(NOT _already_downloaded_spdlog)
if(TARGET spdlog::spdlog)
message(FATAL_ERROR "Expected spdlog::spdlog not to exist before the first call to rapids_cpm_rapids_logger when RAPIDS_LOGGER_HIDE_ALL_SPDLOG_SYMBOLS is ON"
)
endif()
set(CPM_DOWNLOAD_spdlog ON)
rapids_cpm_spdlog(FMT_OPTION "BUNDLED"
# TODO: Get the export sets as input
INSTALL_EXPORT_SET ${_RAPIDS_EXPORT_SET}
BUILD_EXPORT_SET ${_RAPIDS_EXPORT_SET}
# TODO: I don't really expect this to work with the way
# that rapids_cpm_spdlog is set up right now, it's going to
# require some tweaking of argument forwarding I suspect.
CPM_ARGS EXCLUDE_FROM_ALL ON OPTIONS
"BUILD_SHARED_LIBS OFF" "SPDLOG_BUILD_SHARED OFF")
set_property(GLOBAL PROPERTY RAPIDS_LOGGER_DOWNLOADED_SPDLOG ON)
endif()
endif()

set(options)
set(one_value)
set(multi_value)
Expand Down

0 comments on commit 179ce6e

Please sign in to comment.