Quellcode durchsuchen

libsquish: remove limit plat

star9029 vor 1 Jahr
Ursprung
Commit
4a9f72d97a
1 geänderte Dateien mit 13 neuen und 6 gelöschten Zeilen
  1. 13 6
      packages/l/libsquish/xmake.lua

+ 13 - 6
packages/l/libsquish/xmake.lua

@@ -1,5 +1,4 @@
 package("libsquish")
-
     set_homepage("https://sourceforge.net/projects/libsquish/")
     set_description("The libSquish library compresses images with the DXT standard (also known as S3TC).")
     set_license("MIT")
@@ -8,17 +7,25 @@ package("libsquish")
     add_versions("1.15", "628796eeba608866183a61d080d46967c9dda6723bc0a3ec52324c85d2147269")
 
     add_configs("openmp", {description = "Enable OpenMP build.", default = false, type = "boolean"})
-    if is_plat("windows") then
-        add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
-    end
 
     add_deps("cmake")
-    on_install("windows", "macosx", "linux", function (package)
-        local configs = {}
+
+    on_load(function (package)
+        if package:config("openmp") then
+            package:add("deps", "openmp")
+        end
+    end)
+
+    on_install(function (package)
+        local configs = {"-DBUILD_SQUISH_EXTRA=ON"}
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         table.insert(configs, "-DBUILD_SQUISH_WITH_OPENMP=" .. (package:config("openmp") and "ON" or "OFF"))
+        if package:config("shared") and package:is_plat("windows") then
+            table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
+        end
         import("package.tools.cmake").install(package, configs)
+        os.trycp(package:buildir() .. "/**.dll", package:installdir("bin"))
     end)
 
     on_test(function (package)