From: Kefu Chai Date: Mon, 25 Jul 2022 13:57:57 +0000 (+0800) Subject: cmake: disable FMT_USE_TZSET for WIN32 X-Git-Tag: v18.0.0~434^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aa5769ecf1d80fc9824280d2e90fd4c61a0e7769;p=ceph.git cmake: disable FMT_USE_TZSET for WIN32 otherwise we'd have following FTBFS with MinGW, like: ../src/fmt/include/fmt/chrono.h: In lambda function: ../src/fmt/include/fmt/chrono.h:952:5: error: '_tzset' was not declared in this scope; did you mean 'tzset'? 952 | _tzset(); | ^~~~~~ | tzset Signed-off-by: Kefu Chai --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ab2140a5ac1b..a9ab9e3b6da5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -306,6 +306,8 @@ else() add_subdirectory(fmt) set(BUILD_SHARED_LIBS ${old_BUILD_SHARED_LIBS}) unset(old_BUILD_SHARED_LIBS) + target_compile_definitions(fmt PUBLIC + $<$:FMT_USE_TZSET=0>) include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/fmt/include") endif()