From 28c118b03873ee18e8cfcd2f4bca670a4eee1ca3 Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 11 Nov 2024 16:45:18 +0800 Subject: [PATCH] jsoncpp: support more platform (#5729) --- packages/j/jsoncpp/xmake.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/j/jsoncpp/xmake.lua b/packages/j/jsoncpp/xmake.lua index f2386e225..125531745 100644 --- a/packages/j/jsoncpp/xmake.lua +++ b/packages/j/jsoncpp/xmake.lua @@ -3,27 +3,26 @@ package("jsoncpp") set_description("A C++ library for interacting with JSON.") set_license("MIT") - add_urls("https://github.com/open-source-parsers/jsoncpp/archive/$(version).zip", + add_urls("https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/$(version).zip", "https://github.com/open-source-parsers/jsoncpp.git") + add_versions("1.9.4", "6da6cdc026fe042599d9fce7b06ff2c128e8dd6b8b751fca91eb022bce310880") add_versions("1.9.5", "a074e1b38083484e8e07789fd683599d19da8bb960959c83751cd0284bdf2043") add_versions("1.9.6", "0d445d6e956fb62d69ec6895b0000ea6caddf0680373a0d5a37b719c7fbf369b") add_deps("cmake") + on_load(function (package) if package:config("shared") then package:add("defines", "JSON_DLL") end end) - on_install("linux", "macosx", "android", "iphoneos", "windows", "mingw", "cross", function(package) + on_install(function(package) local configs = {"-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF", "-DJSONCPP_WITH_TESTS=OFF", "-DJSONCPP_WITH_EXAMPLE=OFF", "-DBUILD_OBJECT_LIBS=OFF"} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_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") - end import("package.tools.cmake").install(package, configs) end)