aboutsummaryrefslogtreecommitdiff
path: root/thirdparty/fmt/support/cmake
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-11-07 14:49:13 +0100
committerGitHub Enterprise <[email protected]>2025-11-07 14:49:13 +0100
commit24e43a913f29ac3b314354e8ce5175f135bcc64f (patch)
treeca442937ceeb63461012b33a4576e9835099f106 /thirdparty/fmt/support/cmake
parentget oplog attachments (#622) (diff)
downloadzen-24e43a913f29ac3b314354e8ce5175f135bcc64f.tar.xz
zen-24e43a913f29ac3b314354e8ce5175f135bcc64f.zip
switch to xmake for package management (#611)
This change removes our dependency on vcpkg for package management, in favour of bringing some code in-tree in the `thirdparty` folder as well as using the xmake build-in package management feature. For the latter, all the package definitions are maintained in the zen repo itself, in the `repo` folder. It should now also be easier to build the project as it will no longer depend on having the right version of vcpkg installed, which has been a common problem for new people coming in to the codebase. Now you should only need xmake to build. * Bumps xmake requirement on github runners to 2.9.9 to resolve an issue where xmake on Windows invokes cmake with `v144` toolchain which does not exist * BLAKE3 is now in-tree at `thirdparty/blake3` * cpr is now in-tree at `thirdparty/cpr` * cxxopts is now in-tree at `thirdparty/cxxopts` * fmt is now in-tree at `thirdparty/fmt` * robin-map is now in-tree at `thirdparty/robin-map` * ryml is now in-tree at `thirdparty/ryml` * sol2 is now in-tree at `thirdparty/sol2` * spdlog is now in-tree at `thirdparty/spdlog` * utfcpp is now in-tree at `thirdparty/utfcpp` * xmake package repo definitions is in `repo` * implemented support for sanitizers. ASAN is supported on windows, TSAN, UBSAN, MSAN etc are supported on Linux/MacOS though I have not yet tested it extensively on MacOS * the zencore encryption implementation also now supports using mbedTLS which is used on MacOS, though for now we still use openssl on Linux * crashpad * bumps libcurl to 8.11.0 (from 8.8.0) which should address a rare build upload bug
Diffstat (limited to 'thirdparty/fmt/support/cmake')
-rw-r--r--thirdparty/fmt/support/cmake/FindSetEnv.cmake7
-rw-r--r--thirdparty/fmt/support/cmake/JoinPaths.cmake26
-rw-r--r--thirdparty/fmt/support/cmake/fmt-config.cmake.in7
-rw-r--r--thirdparty/fmt/support/cmake/fmt.pc.in11
4 files changed, 51 insertions, 0 deletions
diff --git a/thirdparty/fmt/support/cmake/FindSetEnv.cmake b/thirdparty/fmt/support/cmake/FindSetEnv.cmake
new file mode 100644
index 000000000..4e2da5408
--- /dev/null
+++ b/thirdparty/fmt/support/cmake/FindSetEnv.cmake
@@ -0,0 +1,7 @@
+# A CMake script to find SetEnv.cmd.
+
+find_program(WINSDK_SETENV NAMES SetEnv.cmd
+ PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]/bin")
+if (WINSDK_SETENV AND PRINT_PATH)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${WINSDK_SETENV}")
+endif ()
diff --git a/thirdparty/fmt/support/cmake/JoinPaths.cmake b/thirdparty/fmt/support/cmake/JoinPaths.cmake
new file mode 100644
index 000000000..32d6d6685
--- /dev/null
+++ b/thirdparty/fmt/support/cmake/JoinPaths.cmake
@@ -0,0 +1,26 @@
+# This module provides function for joining paths
+# known from from most languages
+#
+# Original license:
+# SPDX-License-Identifier: (MIT OR CC0-1.0)
+# Explicit permission given to distribute this module under
+# the terms of the project as described in /LICENSE.rst.
+# Copyright 2020 Jan Tojnar
+# https://github.com/jtojnar/cmake-snips
+#
+# Modelled after Python’s os.path.join
+# https://docs.python.org/3.7/library/os.path.html#os.path.join
+# Windows not supported
+function(join_paths joined_path first_path_segment)
+ set(temp_path "${first_path_segment}")
+ foreach(current_segment IN LISTS ARGN)
+ if(NOT ("${current_segment}" STREQUAL ""))
+ if(IS_ABSOLUTE "${current_segment}")
+ set(temp_path "${current_segment}")
+ else()
+ set(temp_path "${temp_path}/${current_segment}")
+ endif()
+ endif()
+ endforeach()
+ set(${joined_path} "${temp_path}" PARENT_SCOPE)
+endfunction()
diff --git a/thirdparty/fmt/support/cmake/fmt-config.cmake.in b/thirdparty/fmt/support/cmake/fmt-config.cmake.in
new file mode 100644
index 000000000..bc1684f24
--- /dev/null
+++ b/thirdparty/fmt/support/cmake/fmt-config.cmake.in
@@ -0,0 +1,7 @@
+@PACKAGE_INIT@
+
+if (NOT TARGET fmt::fmt)
+ include(${CMAKE_CURRENT_LIST_DIR}/@[email protected])
+endif ()
+
+check_required_components(fmt)
diff --git a/thirdparty/fmt/support/cmake/fmt.pc.in b/thirdparty/fmt/support/cmake/fmt.pc.in
new file mode 100644
index 000000000..29976a8af
--- /dev/null
+++ b/thirdparty/fmt/support/cmake/fmt.pc.in
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@libdir_for_pc_file@
+includedir=@includedir_for_pc_file@
+
+Name: fmt
+Description: A modern formatting library
+Version: @FMT_VERSION@
+Libs: -L${libdir} -l@FMT_LIB_NAME@
+Cflags: -I${includedir}
+