Skip to content

Commit 12e6b31

Browse files
fmt: add 11.0.0 version (#4533)
* fmt: add 11.0.0 verson * fix unicode * add unicode config * Update xmake.lua
1 parent 5d64ae3 commit 12e6b31

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/f/fmt/xmake.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package("fmt")
2-
32
set_homepage("https://fmt.dev")
43
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.")
54

65
set_urls("https://github.com/fmtlib/fmt/releases/download/$(version)/fmt-$(version).zip",
76
"https://github.com/fmtlib/fmt.git")
7+
8+
add_versions("11.0.0", "583ce480ef07fad76ef86e1e2a639fc231c3daa86c4aa6bcba524ce908f30699")
89
add_versions("10.2.1", "312151a2d13c8327f5c9c586ac6cf7cddc1658e8f53edae0ec56509c8fa516c9")
910
add_versions("10.2.0", "8a942861a94f8461a280f823041cde8f620a6d8b0e0aacc98c15bb5a9dd92399")
1011
add_versions("10.1.1", "b84e58a310c9b50196cda48d5678d5fa0849bca19e5fdba6b684f0ee93ed9d1b")
@@ -25,6 +26,7 @@ package("fmt")
2526
"3280569bced9ec08933f0ea37b6a4fef4538944d9046fe197ad63e22d1357cd4")
2627

2728
add_configs("header_only", {description = "Use header only version.", default = false, type = "boolean"})
29+
add_configs("unicode", {description = "Enable Unicode support.", default = true, type = "boolean"})
2830

2931
if is_plat("mingw") and is_subhost("msys") then
3032
add_extsources("pacman::fmt")
@@ -48,6 +50,9 @@ package("fmt")
4850
package:add("defines", "FMT_EXPORT")
4951
end
5052
end
53+
if package:is_plat("windows") and package:config("unicode") then
54+
package:add("cxxflags", "/utf-8")
55+
end
5156
end)
5257

5358
on_install(function (package)
@@ -58,7 +63,8 @@ package("fmt")
5863
io.gsub("CMakeLists.txt", "MASTER_PROJECT AND CMAKE_GENERATOR MATCHES \"Visual Studio\"", "0")
5964
local configs = {"-DFMT_TEST=OFF", "-DFMT_DOC=OFF", "-DFMT_FUZZ=OFF", "-DCMAKE_CXX_VISIBILITY_PRESET=default"}
6065
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
61-
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
66+
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
67+
table.insert(configs, "-DFMT_UNICODE=" .. (package:config("unicode") and "ON" or "OFF"))
6268
import("package.tools.cmake").install(package, configs)
6369
end)
6470

@@ -73,4 +79,3 @@ package("fmt")
7379
}
7480
]]}, {configs = {languages = "c++14"}, includes = "fmt/format.h"}))
7581
end)
76-

0 commit comments

Comments
 (0)