]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: disable FMT_USE_TZSET for WIN32
authorKefu Chai <tchaikov@gmail.com>
Mon, 25 Jul 2022 13:57:57 +0000 (21:57 +0800)
committerKefu Chai <tchaikov@gmail.com>
Mon, 25 Jul 2022 13:59:07 +0000 (21:59 +0800)
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 <tchaikov@gmail.com>
src/CMakeLists.txt

index ab2140a5ac1b897d7a8b7ddc064d2f1b2d5d5cf7..a9ab9e3b6da5ab63652d4750c5a32e2496568a27 100644 (file)
@@ -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
+    $<$<BOOL:${WIN32}>:FMT_USE_TZSET=0>)
   include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/fmt/include")
 endif()