ソースを参照

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
yszhou2019 3 年 前
コミット
7ca5c4d779
1 ファイル変更16 行追加3 行削除
  1. 16 3
      packages/q/quickjs/xmake.lua

+ 16 - 3
packages/q/quickjs/xmake.lua

@@ -3,15 +3,20 @@ package("quickjs")
     set_homepage("https://bellard.org/quickjs/")
     set_homepage("https://bellard.org/quickjs/")
     set_description("QuickJS is a small and embeddable Javascript engine")
     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
     if is_plat("linux", "macosx", "iphoneos", "cross") then
         add_syslinks("pthread", "dl", "m")
         add_syslinks("pthread", "dl", "m")
     elseif is_plat("android") then
     elseif is_plat("android") then
         add_syslinks("dl", "m")
         add_syslinks("dl", "m")
     end
     end
-
+    
     on_install("linux", "macosx", "iphoneos", "android", "mingw", "cross", function (package)
     on_install("linux", "macosx", "iphoneos", "android", "mingw", "cross", function (package)
         io.writefile("xmake.lua", ([[
         io.writefile("xmake.lua", ([[
             add_rules("mode.debug", "mode.release")
             add_rules("mode.debug", "mode.release")
@@ -38,6 +43,14 @@ package("quickjs")
         import("package.tools.xmake").install(package, configs)
         import("package.tools.xmake").install(package, configs)
     end)
     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)
     on_test(function (package)
         assert(package:has_cfuncs("JS_NewRuntime", {includes = "quickjs.h"}))
         assert(package:has_cfuncs("JS_NewRuntime", {includes = "quickjs.h"}))
     end)
     end)