Skip to content

Commit 3077e5e

Browse files
Auto-update libcbor to v0.12.0 (#6809)
* Update libcbor to v0.12.0 * fix android cmake * fix cmake lto --------- Co-authored-by: star9029 <[email protected]>
1 parent 91059e5 commit 3077e5e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/l/libcbor/xmake.lua

+12-2
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,27 @@ package("libcbor")
44
set_license("MIT")
55

66
add_urls("https://github.com/pjk/libcbor/archive/refs/tags/$(version).tar.gz",
7-
"https://github.com/pjk/libcbor.git")
7+
"https://github.com/pjk/libcbor.git", {submodules = false})
88

9+
add_versions("v0.12.0", "5368add109db559f546d7ed10f440f39a273b073daa8da4abffc83815069fa7f")
910
add_versions("v0.11.0", "89e0a83d16993ce50651a7501355453f5250e8729dfc8d4a251a78ea23bb26d7")
1011

1112
add_deps("cmake")
1213

1314
on_install(function (package)
14-
local configs = {"-DWITH_EXAMPLES=OFF", "-DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=OFF"}
15+
if not package:config("shared") then
16+
package:add("defines", "CBOR_STATIC_DEFINE")
17+
end
18+
19+
local configs = {
20+
"-DWITH_EXAMPLES=OFF",
21+
"-DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=OFF",
22+
"-DCMAKE_POLICY_DEFAULT_CMP0057=NEW",
23+
}
1524
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
1625
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
1726
table.insert(configs, "-DSANITIZE=" .. (package:config("asan") and "ON" or "OFF"))
27+
table.insert(configs, "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=" .. (package:config("lto") and "ON" or "OFF"))
1828
import("package.tools.cmake").install(package, configs)
1929
end)
2030

0 commit comments

Comments
 (0)