Update fmtlib/fmt to 11.1.4.

Switched away from the rapids-cmake provided version and manually CPM'd it.
rapids-cmake will stop providing fmtlib later this year, and the version currently supported is rather old.
Included the same logic that rapids-cmake currently uses to hopefully provide a smooth transition for edge cases (external fmt, etc).

Added `FMT_SYSTEM_HEADERS=ON` to mark fmt headers as system includes, suppressing any internal warnings.
This commit is contained in:
Allison Piper
2025-03-12 17:46:05 +00:00
parent 5aa5a3c225
commit e6705e3114

View File

@@ -1,17 +1,26 @@
################################################################################
# fmtlib/fmt
include("${rapids-cmake-dir}/cpm/fmt.cmake")
set(export_set_details)
set(install_fmt OFF)
if(NOT BUILD_SHARED_LIBS AND NVBench_ENABLE_INSTALL_RULES)
set(export_set_details BUILD_EXPORT_SET nvbench-targets
INSTALL_EXPORT_SET nvbench-targets)
set(export_set_details BUILD_EXPORT_SET nvbench-targets
INSTALL_EXPORT_SET nvbench-targets)
set(install_fmt ON)
endif()
rapids_cpm_fmt(${export_set_details}
rapids_cpm_find(fmt 11.1.4 ${export_set_details}
GLOBAL_TARGETS fmt::fmt fmt::fmt-header-only
CPM_ARGS
GIT_REPOSITORY "https://github.com/fmtlib/fmt.git"
GIT_TAG "11.1.4"
OPTIONS
# Force static to keep fmt internal.
"BUILD_SHARED_LIBS OFF"
# Suppress warnings from fmt headers by marking them as system.
"FMT_SYSTEM_HEADERS ON"
# Disable install rules since we're linking statically.
"FMT_INSTALL ${install_fmt}"
"CMAKE_POSITION_INDEPENDENT_CODE ON"
)
if(NOT fmt_ADDED)