Skip to content

Commit eac4dfe

Browse files
committed
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.
1 parent c31a082 commit eac4dfe

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

cmake/NVBenchDependencies.cmake

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
################################################################################
22
# fmtlib/fmt
3-
include("${rapids-cmake-dir}/cpm/fmt.cmake")
4-
3+
set(export_set_details)
4+
set(install_fmt OFF)
55
if(NOT BUILD_SHARED_LIBS AND NVBench_ENABLE_INSTALL_RULES)
6-
set(export_set_details BUILD_EXPORT_SET nvbench-targets
7-
INSTALL_EXPORT_SET nvbench-targets)
6+
set(export_set_details BUILD_EXPORT_SET nvbench-targets
7+
INSTALL_EXPORT_SET nvbench-targets)
8+
set(install_fmt ON)
89
endif()
910

10-
rapids_cpm_fmt(${export_set_details}
11+
rapids_cpm_find(fmt 11.1.4 ${export_set_details}
12+
GLOBAL_TARGETS fmt::fmt fmt::fmt-header-only
1113
CPM_ARGS
14+
GIT_REPOSITORY "https://github.com/fmtlib/fmt.git"
15+
GIT_TAG "11.1.4"
1216
OPTIONS
1317
# Force static to keep fmt internal.
1418
"BUILD_SHARED_LIBS OFF"
19+
# Suppress warnings from fmt headers by marking them as system.
20+
"FMT_SYSTEM_HEADERS ON"
21+
# Disable install rules since we're linking statically.
22+
"FMT_INSTALL ${install_fmt}"
23+
"CMAKE_POSITION_INDEPENDENT_CODE ON"
1524
)
1625

1726
if(NOT fmt_ADDED)

0 commit comments

Comments
 (0)