aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--repo/packages/f/fmt/patches/10.1.0/utf8.patch13
-rw-r--r--repo/packages/f/fmt/xmake.lua74
-rw-r--r--src/zen/xmake.lua2
-rw-r--r--src/zencore/xmake.lua2
-rw-r--r--xmake.lua2
5 files changed, 3 insertions, 90 deletions
diff --git a/repo/packages/f/fmt/patches/10.1.0/utf8.patch b/repo/packages/f/fmt/patches/10.1.0/utf8.patch
deleted file mode 100644
index c415bd924..000000000
--- a/repo/packages/f/fmt/patches/10.1.0/utf8.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/include/fmt/format.h b/include/fmt/format.h
-index e5bd8b1..1a05db3 100644
---- a/include/fmt/format.h
-+++ b/include/fmt/format.h
-@@ -1453,7 +1453,7 @@ template <typename WChar, typename Buffer = memory_buffer> class to_utf8 {
- ++p;
- if (p == s.end() || (c & 0xfc00) != 0xd800 || (*p & 0xfc00) != 0xdc00) {
- if (policy == to_utf8_error_policy::abort) return false;
-- buf.append(string_view("�"));
-+ buf.append(string_view("\xEF\xBF\xBD"));
- --p;
- } else {
- c = (c << 10) + static_cast<uint32_t>(*p) - 0x35fdc00;
diff --git a/repo/packages/f/fmt/xmake.lua b/repo/packages/f/fmt/xmake.lua
deleted file mode 100644
index f0a1771c1..000000000
--- a/repo/packages/f/fmt/xmake.lua
+++ /dev/null
@@ -1,74 +0,0 @@
-package("fmt")
-
- set_homepage("https://fmt.dev")
- set_description("fmt is an open-source formatting library for C++. It can be used as a safe and fast alternative to (s)printf and iostreams.")
-
- set_urls("https://github.com/fmtlib/fmt/releases/download/$(version)/fmt-$(version).zip",
- "https://github.com/fmtlib/fmt.git")
- add_versions("10.1.1", "b84e58a310c9b50196cda48d5678d5fa0849bca19e5fdba6b684f0ee93ed9d1b")
- add_versions("10.1.0", "d725fa83a8b57a3cedf238828fa6b167f963041e8f9f7327649bddc68ae316f4")
- add_versions("10.0.0", "4943cb165f3f587f26da834d3056ee8733c397e024145ca7d2a8a96bb71ac281")
- add_versions("9.1.0", "cceb4cb9366e18a5742128cb3524ce5f50e88b476f1e54737a47ffdf4df4c996")
- add_versions("9.0.0", "fc96dd2d2fdf2bded630787adba892c23cb9e35c6fd3273c136b0c57d4651ad6")
- add_versions("8.1.1", "23778bad8edba12d76e4075da06db591f3b0e3c6c04928ced4a7282ca3400e5d")
- add_versions("8.0.1", "a627a56eab9554fc1e5dd9a623d0768583b3a383ff70a4312ba68f94c9d415bf")
- add_versions("8.0.0", "36016a75dd6e0a9c1c7df5edb98c93a3e77dabcf122de364116efb9f23c6954a")
- add_versions("7.1.3", "5d98c504d0205f912e22449ecdea776b78ce0bb096927334f80781e720084c9f")
- add_versions("6.2.0", "a4468d528682143dcef2f16068104e03ef50467b0170b6125c9caf777d27bf10")
- add_versions("6.0.0", "b4a16b38fa171f15dbfb958b02da9bbef2c482debadf64ac81ec61b5ac422440")
- add_versions("5.3.0", "4c0741e10183f75d7d6f730b8708a99b329b2f942dad5a9da3385ab92bb4a15c")
-
- add_patches("10.1.0",
- path.join(os.scriptdir(), "patches", "10.1.0", "utf8.patch" ),
- "3280569bced9ec08933f0ea37b6a4fef4538944d9046fe197ad63e22d1357cd4")
-
- add_configs("header_only", {description = "Use header only version.", default = false, type = "boolean"})
-
- if is_plat("mingw") and is_subhost("msys") then
- add_extsources("pacman::fmt")
- elseif is_plat("linux") then
- add_extsources("pacman::fmt", "apt::libfmt-dev")
- elseif is_plat("macosx") then
- add_extsources("brew::fmt")
- end
-
- on_load(function (package)
- if package:config("header_only") then
- package:add("defines", "FMT_HEADER_ONLY=1")
- else
- package:add("deps", "cmake")
- end
- if package:config("shared") then
- local version = package:version()
- if version and version:ge("10") then
- package:add("defines", "FMT_LIB_EXPORT")
- else
- package:add("defines", "FMT_EXPORT")
- end
- end
- end)
-
- on_install(function (package)
- if package:config("header_only") then
- os.cp("include/fmt", package:installdir("include"))
- return
- end
- io.gsub("CMakeLists.txt", "MASTER_PROJECT AND CMAKE_GENERATOR MATCHES \"Visual Studio\"", "0")
- local configs = {"-DFMT_TEST=OFF", "-DFMT_DOC=OFF", "-DFMT_FUZZ=OFF", "-DCMAKE_CXX_VISIBILITY_PRESET=default"}
- table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
- table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
- import("package.tools.cmake").install(package, configs)
- end)
-
- on_test(function (package)
- assert(package:check_cxxsnippets({test = [[
- #include <fmt/format.h>
- #include <string>
- #include <assert.h>
- static void test() {
- std::string s = fmt::format("{}", "hello");
- assert(s == "hello");
- }
- ]]}, {configs = {languages = "c++14"}, includes = "fmt/format.h"}))
- end)
-
diff --git a/src/zen/xmake.lua b/src/zen/xmake.lua
index 27c7d76ea..cb704054e 100644
--- a/src/zen/xmake.lua
+++ b/src/zen/xmake.lua
@@ -29,4 +29,4 @@ target("zen")
add_ldflags("-framework SystemConfiguration")
end
- add_packages("vcpkg::mimalloc", "fmt")
+ add_packages("vcpkg::mimalloc", "vcpkg::fmt")
diff --git a/src/zencore/xmake.lua b/src/zencore/xmake.lua
index 5cdeb1e10..a95473340 100644
--- a/src/zencore/xmake.lua
+++ b/src/zencore/xmake.lua
@@ -42,7 +42,7 @@ target('zencore')
add_packages(
"vcpkg::eastl",
- "fmt",
+ "vcpkg::fmt",
"vcpkg::gsl-lite",
"vcpkg::lz4",
"xxhash",
diff --git a/xmake.lua b/xmake.lua
index 20ae141a6..2f661f221 100644
--- a/xmake.lua
+++ b/xmake.lua
@@ -5,11 +5,11 @@ set_configvar("ZEN_SCHEMA_VERSION", 5) -- force state wipe after 0.2.31 causing
add_repositories("zen-repo repo")
add_requires("xxhash 0.8.2", {system = false})
-add_requires("fmt", {system = false})
add_requires(
"vcpkg::curl",
"vcpkg::eastl",
+ "vcpkg::fmt",
"vcpkg::gsl-lite",
"vcpkg::http-parser",
"vcpkg::json11",