update assimp and draco (#987)

* update assimp and draco

* fix zlib finding

* disable custom zlib finding

* restore workaround

* fix indent
pull/991/head
Hoildkv 3 years ago committed by GitHub
parent 0d62a81cad
commit 92957338fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 79
      packages/a/assimp/xmake.lua
  2. 1
      packages/d/draco/xmake.lua
  3. 2
      packages/z/zlib/xmake.lua

@ -2,9 +2,11 @@ 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",
"https://github.com/assimp/assimp.git")
add_versions("v5.2.1", "636fe5c2cfe925b559b5d89e53a42412a2d2ab49a0712b7d655d1b84c51ed504")
add_versions("v5.1.4", "59a00cf72fa5ceff960460677e2b37be5cd1041e85bae9c02828c27ade7e4160")
add_versions("v5.0.1", "d10542c95e3e05dece4d97bb273eba2dfeeedb37a78fb3417fd4d5e94d879192")
add_patches("v5.0.1", path.join(os.scriptdir(), "patches", "5.0.1", "fix-mingw.patch"), "a3375489e2bbb2dd97f59be7dd84e005e7e9c628b4395d7022a6187ca66b5abb")
@ -21,72 +23,59 @@ package("assimp")
add_extsources("brew::assimp")
end
add_configs("asan", {description = "Enable AddressSanitizer", default = false, type = "boolean"})
add_configs("build_tools", {description = "If the supplementary tools for Assimp are built in addition to the library", default = false, type = "boolean"})
add_configs("double_precision", {description = "All data will be stored as double values", default = false, type = "boolean"})
add_configs("no_export", {description = "Disable Assimp's export functionality (reduces library size)", default = false, type = "boolean"})
add_configs("ubsan", {description = "Enable Undefined Behavior sanitizer", default = false, type = "boolean"})
add_configs("build_tools", {description = "Build the supplementary tools for Assimp.", default = false, type = "boolean"})
add_configs("double_precision", {description = "Enable double precision processing.", default = false, type = "boolean"})
add_configs("no_export", {description = "Disable Assimp's export functionality (reduces library size).", default = false, type = "boolean"})
add_configs("android_jniiosysystem", {description = "Enable Android JNI IOSystem support.", default = false, type = "boolean"})
add_configs("asan", {description = "Enable AddressSanitizer.", default = false, type = "boolean"})
add_configs("ubsan", {description = "Enable Undefined Behavior sanitizer.", default = false, type = "boolean"})
add_deps("cmake", "irrxml", "zlib")
add_deps("cmake", "zlib")
if is_plat("windows") then
add_syslinks("advapi32")
end
on_load(function (package)
if is_plat("linux") and package:config("shared") then
package:add("ldflags", "-Wl,--as-needed," .. package:installdir("lib", "libassimp.so"))
if package:version():le("5.1.0") then
package:add("deps", "irrxml")
if package:is_plat("linux") and package:config("shared") then
package:add("ldflags", "-Wl,--as-needed," .. package:installdir("lib", "libassimp.so"))
end
end
end)
on_install("windows", "linux", "macosx", "mingw", function (package)
local configs = {}
table.insert(configs, "-DASSIMP_BUILD_SAMPLES=OFF")
table.insert(configs, "-DASSIMP_BUILD_TESTS=OFF")
table.insert(configs, "-DBUILD_DOCS=OFF")
table.insert(configs, "-DBUILD_FRAMEWORK=OFF")
table.insert(configs, "-DINJECT_DEBUG_POSTFIX=" .. ((package:debug()) and "ON" or "OFF"))
table.insert(configs, "-DASSIMP_INSTALL_PDB=ON")
local irrxml = package:dep("irrxml")
if irrxml then
table.insert(configs, "-DSYSTEM_IRRXML=ON")
if irrxml:is_system() then
io.replace("CMakeLists.txt", "FIND_PACKAGE( IrrXML REQUIRED )", "", {plain = true})
else
local fetchinfo = irrxml:fetch()
table.insert(configs, "-DIRRXML_INCLUDE_DIR=" .. table.concat(fetchinfo.includedirs or fetchinfo.sysincludedirs, ";"))
table.insert(configs, "-DIRRXML_LIBRARY=" .. table.concat(fetchinfo.libfiles, ";"))
end
else
table.insert(configs, "-DSYSTEM_IRRXML=OFF")
end
local configs = {"-DASSIMP_BUILD_SAMPLES=OFF",
"-DASSIMP_BUILD_TESTS=OFF",
"-DASSIMP_BUILD_DOCS=OFF",
"-DASSIMP_BUILD_FRAMEWORK=OFF",
"-DASSIMP_INSTALL_PDB=ON",
"-DASSIMP_INJECT_DEBUG_POSTFIX=ON",
"-DASSIMP_BUILD_ZLIB=OFF",
"-DSYSTEM_IRRXML=ON"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
-- temporary workaround
local zlib = package:dep("zlib")
if zlib then
if not zlib:is_system() then
local fetchinfo = zlib:fetch()
io.replace("CMakeLists.txt", "FIND_PACKAGE(ZLIB)", "", {plain = true})
io.replace("CMakeLists.txt", [[INSTALL( TARGETS zlib zlibstatic
if zlib and not zlib:is_system() then
local fetchinfo = zlib:fetch()
io.replace("CMakeLists.txt", "FIND_PACKAGE(ZLIB)", "", {plain = true})
io.replace("CMakeLists.txt", [[INSTALL( TARGETS zlib zlibstatic
EXPORT "${TARGETS_EXPORT_NAME}")]], "", {plain = true})
table.insert(configs, "-DZLIB_FOUND=TRUE")
table.insert(configs, "-DZLIB_INCLUDE_DIR=" .. table.concat(fetchinfo.includedirs or fetchinfo.sysincludedirs, ";"))
table.insert(configs, "-DZLIB_LIBRARIES=" .. table.concat(fetchinfo.libfiles, ";"))
end
else
table.insert(configs, "-DASSIMP_BUILD_ZLIB=ON")
table.insert(configs, "-DZLIB_FOUND=TRUE")
table.insert(configs, "-DZLIB_INCLUDE_DIR=" .. table.concat(fetchinfo.includedirs or fetchinfo.sysincludedirs, ";"))
table.insert(configs, "-DZLIB_LIBRARIES=" .. table.concat(fetchinfo.libfiles, ";"))
end
local function add_config_arg(config_name, cmake_name)
table.insert(configs, "-D" .. cmake_name .. "=" .. (package:config(config_name) and "ON" or "OFF"))
end
add_config_arg("asan", "ASSIMP_ASAN")
add_config_arg("shared", "BUILD_SHARED_LIBS")
add_config_arg("double_precision", "ASSIMP_DOUBLE_PRECISION")
add_config_arg("no_export", "ASSIMP_NO_EXPORT")
add_config_arg("shared", "BUILD_SHARED_LIBS")
add_config_arg("asan", "ASSIMP_ASAN")
add_config_arg("ubsan", "ASSIMP_UBSAN")
if package:is_plat("android") then
add_config_arg("android_jniiosysystem", "ASSIMP_ANDROID_JNIIOSYSTEM")
end

@ -7,6 +7,7 @@ package("draco")
add_urls("https://github.com/google/draco/archive/refs/tags/$(version).tar.gz",
"https://github.com/google/draco.git")
add_versions("1.4.1", "83aa5637d36a835103a61f96af7ff04c6d6528e643909466595d51ee715417a9")
add_versions("1.5.0", "81a91dcc6f22170a37ef67722bb78d018e642963e6c56e373560445ce7468a20")
add_deps("cmake")
on_install("windows", "linux", "macosx", function (package)

@ -21,7 +21,7 @@ package("zlib")
add_rules("mode.debug", "mode.release")
target("zlib")
set_kind("$(kind)")
if not is_plat("windows", "mingw") then
if not is_plat("windows") then
set_basename("z")
end
add_files("adler32.c")

Loading…
Cancel
Save