From 4e91f1a60ca30f17a047d17955d06033b976c282 Mon Sep 17 00:00:00 2001 From: zjyhjqs <141055431+zjyhjqs@users.noreply.github.com> Date: Wed, 29 May 2024 07:13:50 +0800 Subject: [PATCH] Upgrade json-c to 0.17 (#4181) * Update `json-c` to 0.17 * Remove `json-c 0.13` due to lack of CMake support --- packages/j/json-c/xmake.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/j/json-c/xmake.lua b/packages/j/json-c/xmake.lua index 66c8c82b6..661826e87 100644 --- a/packages/j/json-c/xmake.lua +++ b/packages/j/json-c/xmake.lua @@ -5,19 +5,19 @@ package("json-c") set_urls("https://github.com/json-c/json-c/archive/refs/tags/json-c-$(version).zip") - add_versions("0.13.1-20180305", "8a244527eb4f697362f713f7d6dca3f6f9b5335e18fe7b705130ae62e599e864") + add_versions("0.17-20230812", "471e9eb1dad4fd2e4fec571d8415993e66a89f23a5b052f1ba11b54db90252de") - if is_plat("windows") and winos.version():gt("winxp") then - add_deps("cmake") - on_install("windows", function (package) - import("package.tools.cmake").install(package) - os.cp("json_object_iterator.h", package:installdir("include/json-c")) - end) - end - - on_install("linux", "macosx", "iphoneos", "android", function (package) - local configs = {"--disable-dependency-tracking", "--disable-silent-rules", "--enable-shared=no"} - import("package.tools.autoconf").install(package, configs) + add_deps("cmake") + on_install(function (package) + local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_APPS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) + if package:config("pic") ~= false then + table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") + table.insert(configs, "-DDISABLE_STATIC_FPIC=OFF") + end + import("package.tools.cmake").install(package, configs) end) on_test(function (package)