|
@@ -1,11 +1,12 @@
|
|
|
package("assimp")
|
|
|
-
|
|
|
set_homepage("https://assimp.org")
|
|
|
set_description("Portable Open-Source library to import various well-known 3D model formats in a uniform manner")
|
|
|
set_license("BSD-3-Clause")
|
|
|
|
|
|
- set_urls("https://github.com/assimp/assimp/archive/$(version).zip",
|
|
|
+ set_urls("https://github.com/assimp/assimp/archive/refs/tags/$(version).zip",
|
|
|
"https://github.com/assimp/assimp.git")
|
|
|
+ add_versions("v5.3.1", "f4020735fe4601de9d85cb335115568cce0e027a65e546dd8895081696d624bd")
|
|
|
+ add_versions("v5.3.0", "cccbd20522b577613096b0b157f62c222f844bc177356b8301cd74eee3fecadb")
|
|
|
add_versions("v5.2.5", "5384877d53be7b5bbf50c26ab3f054bec91b3df8614372dcd7240f44f61c509b")
|
|
|
add_versions("v5.2.4", "713e9aa035ae019e5f3f0de1605de308d63538897249a2ba3a2d7d40036ad2b1")
|
|
|
add_versions("v5.2.3", "9667cfc8ddabd5dd5e83f3aebb99dbf232fce99f17b9fe59540dccbb5e347393")
|
|
@@ -47,8 +48,14 @@ package("assimp")
|
|
|
end
|
|
|
|
|
|
on_load(function (package)
|
|
|
- if not package:gitref() and package:version():le("5.1.0") then
|
|
|
- package:add("deps", "irrxml")
|
|
|
+ if not package:gitref() then
|
|
|
+ if package:version():le("5.1.0") then
|
|
|
+ package:add("deps", "irrxml")
|
|
|
+ end
|
|
|
+ if package:version():eq("5.3.0") then
|
|
|
+ package:add("deps", "utfcpp")
|
|
|
+ package:add("defines", "ASSIMP_USE_HUNTER")
|
|
|
+ end
|
|
|
end
|
|
|
if package:is_plat("linux", "macosx") and package:config("shared") then
|
|
|
package:add("links", "assimp" .. (package:is_debug() and "d" or ""))
|
|
@@ -56,6 +63,13 @@ package("assimp")
|
|
|
end)
|
|
|
|
|
|
on_install(function (package)
|
|
|
+ if package:is_plat("android") then
|
|
|
+ import("core.tool.toolchain")
|
|
|
+ local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()})
|
|
|
+ local ndk_sdkver = ndk:config("ndk_sdkver")
|
|
|
+ assert(ndk_sdkver and tonumber(ndk_sdkver) >= 26, "package(assimp): need ndk api level >= 26 for android")
|
|
|
+ end
|
|
|
+
|
|
|
local configs = {"-DASSIMP_BUILD_SAMPLES=OFF",
|
|
|
"-DASSIMP_BUILD_TESTS=OFF",
|
|
|
"-DASSIMP_BUILD_DOCS=OFF",
|
|
@@ -118,6 +132,21 @@ package("assimp")
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+ local zlib = package:dep("zlib")
|
|
|
+ if zlib and not zlib:is_system() then
|
|
|
+ local fetchinfo = zlib:fetch({external = false})
|
|
|
+ if fetchinfo then
|
|
|
+ local includedirs = fetchinfo.includedirs or fetchinfo.sysincludedirs
|
|
|
+ if includedirs and #includedirs > 0 then
|
|
|
+ table.insert(configs, "-DZLIB_INCLUDE_DIR=" .. table.concat(includedirs, " "))
|
|
|
+ end
|
|
|
+ local libfiles = fetchinfo.libfiles
|
|
|
+ if libfiles then
|
|
|
+ table.insert(configs, "-DZLIB_LIBRARY=" .. table.concat(libfiles, " "))
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
import("package.tools.cmake").install(package, configs, {ldflags = ldflags, shflags = ldflags})
|
|
|
|
|
|
-- copy pdb
|