]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
build: globally set FMT_USE_TZSET=0 for Windows 52688/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 28 Jul 2023 11:27:56 +0000 (11:27 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 28 Jul 2023 14:34:37 +0000 (14:34 +0000)
We're currently setting FMT_USE_TZSET=0 when building libfmt
in order to avoid the _tzset function, which is unavailable
under Mingw:
https://github.com/ceph/ceph/commit/aa5769ecf1d80fc9824280d2e90fd4c61a0e7769

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 <lpetrut@cloudbasesolutions.com>
CMakeLists.txt
src/CMakeLists.txt

index 2852a7488acb43cfba624cee7368004a439828c2..1778a7202649afa6b313a44302b9d0a00a626931 100644 (file)
@@ -46,6 +46,7 @@ if(WIN32)
   # https://github.com/msys2/MINGW-packages/issues/3319
   add_definitions(
     -D_WIN32_WINNT=${WIN32_WINNT}
+    -DFMT_USE_TZSET=0
     -DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
     -DBOOST_THREAD_V2_SHARED_MUTEX
   )
index 25af73a28aea034215e857675e354a56e83fdc40..2d2d7f67ee41aee561810d6b478be75ab0d999ea 100644 (file)
@@ -337,8 +337,6 @@ 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()