Skip to content

Commit fd9063d

Browse files
committed
Guard fmt def behind nvcc check.
1 parent 70eba11 commit fd9063d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmake/NVBenchConfigTarget.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,17 @@ else()
6666
endif()
6767
endif()
6868

69-
# fmtlib uses llvm's _BitInt internally, which is not available when compiling through nvcc:
70-
target_compile_definitions(nvbench.build_interface INTERFACE "FMT_USE_BITINT=0")
71-
7269
# Experimental filesystem library
7370
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
7471
target_link_libraries(nvbench.build_interface INTERFACE stdc++fs)
7572
endif()
7673

7774
# CUDA-specific flags
75+
if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
76+
# fmtlib uses llvm's _BitInt internally, which is not available when compiling through nvcc:
77+
target_compile_definitions(nvbench.build_interface INTERFACE "FMT_USE_BITINT=0")
78+
endif()
79+
7880
target_compile_options(nvbench.build_interface INTERFACE
7981
$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:-Xcudafe=--display_error_number>
8082
$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:-Wno-deprecated-gpu-targets>

0 commit comments

Comments
 (0)