Skip to content

Commit 5fd67e1

Browse files
build: globally set FMT_USE_TZSET=0 for Windows
We're currently setting FMT_USE_TZSET=0 when building libfmt in order to avoid the _tzset function, which is unavailable under Mingw: ceph@aa5769e The issue is that it still gets used by fmt/chrono.h, which is why we'll move this definition to the top level cmake file. Note that the Windows build is currently failing as a result of a recent change: https://github.com/ceph/ceph/pull/52590/files In file included from ceph/src/common/ceph_time.h:22, from ceph/src/include/encoding.h:31, from ceph/src/include/uuid.h:9, from ceph/src/include/types.h:21, from ceph/src/crush/CrushWrapper.h:14, from ceph/src/crush/CrushCompiler.h:7, from ceph/src/crush/CrushCompiler.cc:4: ceph/src/fmt/include/fmt/chrono.h: In lambda function: ceph/src/fmt/include/fmt/chrono.h:953:5: error: ‘_tzset’ was not declared in this scope; did you mean ‘tzset’? 953 | _tzset(); | ^~~~~~ | tzset Signed-off-by: Lucian Petrut <[email protected]>
1 parent 8e6c03f commit 5fd67e1

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ if(WIN32)
4646
# https://github.com/msys2/MINGW-packages/issues/3319
4747
add_definitions(
4848
-D_WIN32_WINNT=${WIN32_WINNT}
49+
-DFMT_USE_TZSET=0
4950
-DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
5051
-DBOOST_THREAD_V2_SHARED_MUTEX
5152
)

src/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,6 @@ else()
337337
add_subdirectory(fmt)
338338
set(BUILD_SHARED_LIBS ${old_BUILD_SHARED_LIBS})
339339
unset(old_BUILD_SHARED_LIBS)
340-
target_compile_definitions(fmt PUBLIC
341-
$<$<BOOL:${WIN32}>:FMT_USE_TZSET=0>)
342340
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/fmt/include")
343341
endif()
344342

0 commit comments

Comments
 (0)