浏览代码

libsodium: Fix static and shared build (#4591)

Both libs were built
Jérôme Leclercq 1 年之前
父节点
当前提交
8715fcd9dd
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12 1
      packages/l/libsodium/xmake.lua

+ 12 - 1
packages/l/libsodium/xmake.lua

@@ -21,7 +21,18 @@ package("libsodium")
         end
 
         if package:is_plat("linux", "macosx") then
-            import("package.tools.autoconf").install(package)
+            local configs = {}
+            if package:debug() then
+                table.insert(configs, "--enable-debug")
+            end
+            if package:config("shared") then
+                table.insert(configs, "--enable-static=no")
+                table.insert(configs, "--enable-shared=yes")
+            else
+                table.insert(configs, "--enable-static=yes")
+                table.insert(configs, "--enable-shared=no")
+            end
+            import("package.tools.autoconf").install(package, configs)
         else
             os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
             import("package.tools.xmake").install(package)