From 7ca5c4d779a7dbc5112b8aa0b323b276d851c840 Mon Sep 17 00:00:00 2001 From: yszhou2019 <59953951+yszhou2019@users.noreply.github.com> Date: Mon, 27 Jun 2022 14:38:16 +0800 Subject: [PATCH] update qjs msvc (#1309) * update quickjs msvc * specific msrt in premake5.lua * local MD/MT succ * move dll to bin * change premake to xmake * remove unused syslink * set mirror image instead of patch * fix log2 --- packages/q/quickjs/xmake.lua | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/q/quickjs/xmake.lua b/packages/q/quickjs/xmake.lua index c110d7a74..87cdbe1f9 100644 --- a/packages/q/quickjs/xmake.lua +++ b/packages/q/quickjs/xmake.lua @@ -3,15 +3,20 @@ package("quickjs") set_homepage("https://bellard.org/quickjs/") set_description("QuickJS is a small and embeddable Javascript engine") - add_urls("https://github.com/bellard/quickjs.git") - add_versions("2021.03.27", "b5e62895c619d4ffc75c9d822c8d85f1ece77e5b") + if is_plat("windows") then + add_urls("https://github.com/xmake-mirror/quickjs.git") + add_versions("2021.03.27", "c83f82dce8988334be6c6a7b9b029eb963e7e310") + else + add_urls("https://github.com/bellard/quickjs.git") + add_versions("2021.03.27", "b5e62895c619d4ffc75c9d822c8d85f1ece77e5b") + end if is_plat("linux", "macosx", "iphoneos", "cross") then add_syslinks("pthread", "dl", "m") elseif is_plat("android") then add_syslinks("dl", "m") end - + on_install("linux", "macosx", "iphoneos", "android", "mingw", "cross", function (package) io.writefile("xmake.lua", ([[ add_rules("mode.debug", "mode.release") @@ -38,6 +43,14 @@ package("quickjs") import("package.tools.xmake").install(package, configs) end) + on_install("windows", function (package) + local configs = {} + if package:config("shared") then + configs.kind = "shared" + end + import("package.tools.xmake").install(package, configs) + end) + on_test(function (package) assert(package:has_cfuncs("JS_NewRuntime", {includes = "quickjs.h"})) end) \ No newline at end of file