diff options
Diffstat (limited to 'third_party/packages/c/cjson/xmake.lua')
-rw-r--r-- | third_party/packages/c/cjson/xmake.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/third_party/packages/c/cjson/xmake.lua b/third_party/packages/c/cjson/xmake.lua new file mode 100644 index 0000000..7193121 --- /dev/null +++ b/third_party/packages/c/cjson/xmake.lua @@ -0,0 +1,23 @@ +package("cjson") + +set_homepage("https://github.com/DaveGamble/cJSON") +set_description("Ultralightweight JSON parser in ANSI C.") +set_license("MIT") + +set_urls("https://github.com/DaveGamble/cJSON/archive/v$(version).zip", + "https://github.com/DaveGamble/cJSON.git") + +add_versions("1.7.17", "51f3b07aece8d1786e74b951fd92556506586cb36670741b6bfb79bf5d484216") + +add_deps("cmake") + +on_install("windows", "macosx", "linux", "mingw", "iphoneos", "android", function(package) + local configs = { "-DENABLE_CJSON_TEST=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")) + import("package.tools.cmake").install(package, configs) +end) + +on_test(function(package) + assert(package:has_cfuncs("cJSON_malloc", { includes = "cjson/cJSON.h" })) +end)
\ No newline at end of file |