Skip to content

Commit

Permalink
fix assimp for old version (#2994)
Browse files Browse the repository at this point in the history
* fix assimp for old version

* Update xmake.lua
  • Loading branch information
waruqi authored Dec 26, 2023
1 parent fb077c5 commit dd835e9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/a/assimp/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,17 @@ package("assimp")
table.insert(configs, "-DASSIMP_BUILD_ASSIMP_TOOLS=OFF")
end

if not package:gitref() and package:version():lt("v5.2.4") then
-- ASSIMP_WARNINGS_AS_ERRORS is not supported before v5.2.4
-- ASSIMP_WARNINGS_AS_ERRORS maybe does not work for some old versions
for _, cmakefile in ipairs(table.join("CMakeLists.txt", os.files("**/CMakeLists.txt"))) do
if package:is_plat("windows") then
io.replace("code/CMakeLists.txt", "TARGET_COMPILE_OPTIONS(assimp PRIVATE /W4 /WX)", "", {plain = true})
io.replace(cmakefile, "/W4 /WX", "", {plain = true})
else
io.replace("code/CMakeLists.txt", "TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror)", "", {plain = true})
io.replace(cmakefile, "-Werror", "", {plain = true})
end
end
if not package:gitref() and package:version():eq("v5.2.5") then
-- Remove /WX from CMakeLists for MSVC: https://github.com/assimp/assimp/pull/5183
io.replace("CMakeLists.txt", "ADD_COMPILE_OPTIONS(/bigobj /W4 /WX )", "ADD_COMPILE_OPTIONS(/bigobj)", {plain = true})
io.replace("CMakeLists.txt", "ADD_COMPILE_OPTIONS(/MP /bigobj /W4 /WX)", "ADD_COMPILE_OPTIONS(/MP /bigobj)", {plain = true})
-- fix cmake_install failed
if not package:gitref() and package:version():ge("v5.3.0") and package:is_plat("windows") and package:is_debug() then
io.replace("code/CMakeLists.txt", "IF(GENERATOR_IS_MULTI_CONFIG)", "IF(TRUE)", {plain = true})
end
if package:is_plat("mingw") and package:version():lt("v5.1.5") then
-- CMAKE_COMPILER_IS_MINGW has been removed: https://github.com/assimp/assimp/pull/4311
Expand Down

0 comments on commit dd835e9

Please sign in to comment.