Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix assimp for old version #2994

Merged
merged 2 commits into from
Dec 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading