Browse Source

Add ext source for lz4 (#826)

Kelvin Zhang 3 years ago
parent
commit
6b897e9f76
1 changed files with 7 additions and 0 deletions
  1. 7 0
      packages/l/lz4/xmake.lua

+ 7 - 0
packages/l/lz4/xmake.lua

@@ -13,6 +13,10 @@ package("lz4")
         end
         end
     end)
     end)
 
 
+    if is_plat("macosx") then
+        add_extsources("brew::lz4")
+    end
+
     on_install(function (package)
     on_install(function (package)
         io.writefile("xmake.lua", [[
         io.writefile("xmake.lua", [[
             add_rules("mode.debug", "mode.release")
             add_rules("mode.debug", "mode.release")
@@ -24,6 +28,9 @@ package("lz4")
                 if is_kind("shared") and is_plat("windows") then
                 if is_kind("shared") and is_plat("windows") then
                     add_defines("LZ4_DLL_EXPORT")
                     add_defines("LZ4_DLL_EXPORT")
                 end
                 end
+                if is_kind("static") then
+                    add_defines("LZ4_HC_STATIC_LINKING_ONLY", "LZ4_STATIC_LINKING_ONLY")
+                end
         ]])
         ]])
         local configs = {}
         local configs = {}
         if package:config("shared") then
         if package:config("shared") then