浏览代码

fix glew dynamic library missing

xq114 4 年之前
父节点
当前提交
d931c7d61d
共有 3 个文件被更改,包括 7 次插入8 次删除
  1. 3 2
      packages/b/blosc/xmake.lua
  2. 1 3
      packages/g/glew/xmake.lua
  3. 3 3
      packages/g/glfw/xmake.lua

+ 3 - 2
packages/b/blosc/xmake.lua

@@ -25,10 +25,11 @@ package("blosc")
             table.insert(configs, "-DBUILD_STATIC=ON")
         end
         import("package.tools.cmake").install(package, configs, {buildir = "build"})
-        if is_host("windows") then
+        if package:is_plat("windows", "mingw") then
+            -- special concern for legacy versions which keep producing the shared library
             local version = package:version()
             if version:le("1.10") and not package:config("shared") then
-                os.rm(package:installdir(lib) .. "/blosc.lib")
+                os.rm(path.join(package:installdir("lib"), "blosc.lib"))
             elseif package:config("shared") then
                 os.cp("build/install/bin", package:installdir())
                 package:addenv("PATH", "bin")

+ 1 - 3
packages/g/glew/xmake.lua

@@ -29,8 +29,6 @@ package("glew")
         package:add("defines", "GLEW_BUILD")
         if package:is_plat("windows") then
             package:add("links", package:config("shared") and "glew32" or "glew32s")
-        elseif package:is_plat("mingw") then
-            package:add("links", "glew32")
         end
     end)
 
@@ -82,7 +80,7 @@ package("glew")
         table.insert(configs, "-DBUILD_UTILS=" .. (package:config("build_utils") and "ON" or "OFF"))
         import("package.tools.cmake").install(package, configs, {buildir = "build"})
         if package:config("shared") then
-            os.cp("build/bin/*.dll", package:installdir("bin"))
+            os.cp("build/install/bin", package:installdir())
             package:addenv("PATH", "bin")
         end
     end)

+ 3 - 3
packages/g/glfw/xmake.lua

@@ -29,9 +29,9 @@ package("glfw")
     on_install("macosx", "windows", "linux", "mingw", function (package)
         local configs = {"-DGLFW_BUILD_DOCS=OFF", "-DGLFW_BUILD_TESTS=OFF", "-DGLFW_BUILD_EXAMPLES=OFF"}
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
-        if is_plat("windows") and vs_runtime and vs_runtime:startswith("MD") then
+        if package:is_plat("windows") and vs_runtime and vs_runtime:startswith("MD") then
             table.insert(configs, "-DUSE_MSVC_RUNTIME_LIBRARY_DLL")
-        elseif is_plat("linux") then
+        elseif package:is_plat("linux") then
             -- patch missing libxrender/includes
             local cflags = {}
             local fetchinfo = package:dep("libxrender"):fetch()
@@ -45,7 +45,7 @@ package("glfw")
             end
         end
         import("package.tools.cmake").install(package, configs, {buildir = "build"})
-        if is_host("windows") and package:config("shared") then
+        if package:is_plat("windows", "mingw") and package:config("shared") then
             os.trycp("build/install/bin", package:installdir())
             package:addenv("PATH", "bin")
         end