summaryrefslogtreecommitdiff
path: root/third_party/packages/c
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2024-03-01 21:51:47 +0800
committerMole Shang <[email protected]>2024-03-01 22:30:17 +0800
commit2c23cf4b3968a2c4f86253dcadba9779bc00e6ff (patch)
treeaba464b31c64045e1a661488e63c511ceb88793f /third_party/packages/c
parent085c2a88d44ebac41c64c32ee6b796ff64e5331f (diff)
downloadhinata-2c23cf4b3968a2c4f86253dcadba9779bc00e6ff.tar.gz
hinata-2c23cf4b3968a2c4f86253dcadba9779bc00e6ff.tar.bz2
hinata-2c23cf4b3968a2c4f86253dcadba9779bc00e6ff.zip
xmake: move deps to third_party dir
Diffstat (limited to 'third_party/packages/c')
-rw-r--r--third_party/packages/c/c11threads/xmake.lua28
-rw-r--r--third_party/packages/c/cjson/xmake.lua23
2 files changed, 51 insertions, 0 deletions
diff --git a/third_party/packages/c/c11threads/xmake.lua b/third_party/packages/c/c11threads/xmake.lua
new file mode 100644
index 0000000..8310ca9
--- /dev/null
+++ b/third_party/packages/c/c11threads/xmake.lua
@@ -0,0 +1,28 @@
+package("c11threads")
+
+set_homepage("https://github.com/jtsiomb/c11threads")
+set_description("Portable C11 threads implementation over POSIX threads and win32 threads.")
+
+add_urls("https://github.com/jtsiomb/c11threads/archive/ec95e1aa82079aefe109d18e5069b79711692064.zip")
+add_versions("1.0-ec95e1a", "9eb5eab9db4c32418eea39543d4883022c81167ea5e37f820f5af972bea7a30e")
+
+on_install("linux", "macosx", function(package)
+ io.writefile("xmake.lua", [[
+ add_rules("mode.debug", "mode.release")
+ target("c11threads")
+ set_kind("static")
+ add_headerfiles("c11threads.h")
+ ]])
+ import("package.tools.xmake").install(package)
+end)
+
+on_install("windows", "mingw", function(package)
+ io.writefile("xmake.lua", [[
+ add_rules("mode.debug", "mode.release")
+ target("c11threads")
+ set_kind("static")
+ add_files("c11threads_win32.c")
+ add_headerfiles("c11threads.h")
+ ]])
+ import("package.tools.xmake").install(package)
+end) \ No newline at end of file
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