Bläddra i källkod

Fix assimp 5.2.3 (#1088)

Jérôme Leclercq 3 år sedan
förälder
incheckning
5fc332057f
2 ändrade filer med 29 tillägg och 9 borttagningar
  1. 27 0
      packages/a/assimp/patches/5.2.3/cmake_static_crt.patch
  2. 2 9
      packages/a/assimp/xmake.lua

+ 27 - 0
packages/a/assimp/patches/5.2.3/cmake_static_crt.patch

@@ -0,0 +1,27 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f48391edf..66f7b726d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -155,22 +155,6 @@ IF (WIN32)
+     # "VCRUNTIME140.dll not found. Try reinstalling the app.", but give users
+     # a choice to opt for the shared runtime if they want.
+     option(USE_STATIC_CRT "Link against the static runtime libraries." OFF)
+-
+-    # The CMAKE_CXX_FLAGS vars can be overriden by some Visual Studio generators, so we use an alternative
+-    # global method here:
+-    if (${USE_STATIC_CRT})
+-      add_compile_options(
+-          $<$<CONFIG:>:/MT>
+-          $<$<CONFIG:Debug>:/MTd>
+-          $<$<CONFIG:Release>:/MT>
+-      )
+-    else()
+-      add_compile_options(
+-          $<$<CONFIG:>:/MD>
+-          $<$<CONFIG:Debug>:/MDd>
+-          $<$<CONFIG:Release>:/MD>
+-      )
+-    endif()
+   ENDIF()
+ ENDIF()
+ 

+ 2 - 9
packages/a/assimp/xmake.lua

@@ -17,6 +17,7 @@ package("assimp")
     add_patches("v5.2.1", path.join(os.scriptdir(), "patches", "5.2.1", "fix_zlib_filefunc_def.patch"), "a9f8a9aa1975888ea751b80c8268296dee901288011eeb1addf518eac40b71b1")
     add_patches("v5.2.2", path.join(os.scriptdir(), "patches", "5.2.1", "fix_zlib_filefunc_def.patch"), "a9f8a9aa1975888ea751b80c8268296dee901288011eeb1addf518eac40b71b1")
     add_patches("v5.2.3", path.join(os.scriptdir(), "patches", "5.2.1", "fix_zlib_filefunc_def.patch"), "a9f8a9aa1975888ea751b80c8268296dee901288011eeb1addf518eac40b71b1")
+    add_patches("v5.2.3", path.join(os.scriptdir(), "patches", "5.2.3", "cmake_static_crt.patch"), "3872a69976055bed9e40814e89a24a3420692885b50e9f9438036e8d809aafb4")
 
     if not is_host("windows") then
         add_extsources("pkgconfig::assimp")
@@ -72,14 +73,6 @@ package("assimp")
         add_config_arg("asan",             "ASSIMP_ASAN")
         add_config_arg("ubsan",            "ASSIMP_UBSAN")
 
-        -- since v5.3.2, assimp allow user to choose C runtime library version, on Windows
-        -- https://github.com/assimp/assimp/pull/4444
-        if package:version():ge("v5.2.3") then
-            if package:is_plat("windows") and (package:config("vs_runtime") == "MT" or package:config("vs_runtime") == "MTd") then
-                table.insert(configs, "-DUSE_STATIC_CRT=ON")
-            end
-        end
-
         if package:is_plat("android") then
             add_config_arg("android_jniiosysystem", "ASSIMP_ANDROID_JNIIOSYSTEM")
         end
@@ -89,7 +82,7 @@ package("assimp")
             table.insert(configs, "-DASSIMP_BUILD_ASSIMP_TOOLS=OFF")
         end
 
-        if package:is_plat("mingw") then
+        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
             io.replace("CMakeLists.txt", "CMAKE_COMPILER_IS_MINGW", "MINGW", {plain = true})
         end