Skip to content

Commit 45a5687

Browse files
committed
Disable unicode in fmtlib on nvcc + msvc.
This doesn't appear to be supported.
1 parent 2afb41a commit 45a5687

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
@@ -45,9 +45,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
4545
# The CUDA `host_runtime.h` header emits this for
4646
# `__cudaUnregisterBinaryUtil`.
4747
nvbench_add_cxx_flag(nvbench.build_interface INTERFACE "/wd4505")
48-
49-
# Required by fmt:
50-
nvbench_add_cxx_flag(nvbench.build_interface INTERFACE "/utf-8")
5148
else()
5249
nvbench_add_cxx_flag(nvbench.build_interface INTERFACE "-Wall")
5350
nvbench_add_cxx_flag(nvbench.build_interface INTERFACE "-Wextra")
@@ -75,6 +72,11 @@ endif()
7572
if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
7673
# fmtlib uses llvm's _BitInt internally, which is not available when compiling through nvcc:
7774
target_compile_definitions(nvbench.build_interface INTERFACE "FMT_USE_BITINT=0")
75+
76+
# NVCC + MSVC does not support unicode execution encoding, disable usages of utf-8 in fmt:
77+
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
78+
target_compile_definitions(nvbench.build_interface INTERFACE "FMT_UNICODE=0")
79+
endif()
7880
endif()
7981

8082
target_compile_options(nvbench.build_interface INTERFACE

0 commit comments

Comments
 (0)