|
1 | 1 | package("libsquish") |
2 | | - |
3 | 2 | set_homepage("https://sourceforge.net/projects/libsquish/") |
4 | 3 | set_description("The libSquish library compresses images with the DXT standard (also known as S3TC).") |
5 | 4 | set_license("MIT") |
6 | 5 |
|
7 | 6 | add_urls("https://sourceforge.net/projects/libsquish/files/libsquish-$(version).tgz") |
8 | 7 | add_versions("1.15", "628796eeba608866183a61d080d46967c9dda6723bc0a3ec52324c85d2147269") |
9 | 8 |
|
10 | | - add_configs("openmp", {description = "Enable OpenMP build.", default = false, type = "boolean"}) |
11 | | - if is_plat("windows") then |
12 | | - add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) |
13 | | - end |
| 9 | + add_configs("openmp", {description = "Build with OpenMP.", default = false, type = "boolean"}) |
| 10 | + add_configs("sse2", {description = "Build with SSE2.", default = false, type = "boolean"}) |
| 11 | + |
| 12 | + on_load(function (package) |
| 13 | + if package:config("openmp") then |
| 14 | + package:add("deps", "openmp") |
| 15 | + package:add("defines", "SQUISH_USE_OPENMP") |
| 16 | + end |
| 17 | + |
| 18 | + if package:config("sse2") then |
| 19 | + package:add("defines", "SQUISH_USE_SSE=2") |
| 20 | + end |
| 21 | + end) |
14 | 22 |
|
15 | | - add_deps("cmake") |
16 | | - on_install("windows", "macosx", "linux", function (package) |
17 | | - local configs = {} |
18 | | - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
19 | | - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
20 | | - table.insert(configs, "-DBUILD_SQUISH_WITH_OPENMP=" .. (package:config("openmp") and "ON" or "OFF")) |
21 | | - import("package.tools.cmake").install(package, configs) |
| 23 | + on_install(function (package) |
| 24 | + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") |
| 25 | + import("package.tools.xmake").install(package, { |
| 26 | + openmp = package:config("openmp"), |
| 27 | + sse2 = package:config("sse2") |
| 28 | + }) |
22 | 29 | end) |
23 | 30 |
|
24 | 31 | on_test(function (package) |
|
0 commit comments