瀏覽代碼

Auto-update ade to v0.1.2 (#4474)

* Update ade to v0.1.2

* patch mingw

---------

Co-authored-by: star9029 <[email protected]>
ruki 1 年之前
父節點
當前提交
48a7261601
共有 2 個文件被更改,包括 35 次插入1 次删除
  1. 27 0
      packages/a/ade/patches/0.1.2/cmake-mingw.patch
  2. 8 1
      packages/a/ade/xmake.lua

+ 27 - 0
packages/a/ade/patches/0.1.2/cmake-mingw.patch

@@ -0,0 +1,27 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index af78061..8aba951 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -39,13 +39,15 @@ function(add_security_flags target)
+             target_compile_options( ${target} PRIVATE -fstack-protector-strong)
+         endif()
+     elseif(WIN32)
+-        target_compile_options( ${target} PRIVATE /GS /DynamicBase)
+-        if(BUILD_WITH_STATIC_CRT)
+-            target_compile_options( ${target} PRIVATE "/MT")
+-        endif()
+-        if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
+-            # These options for 32 bit builds only
+-            target_compile_options( ${target} PRIVATE /SAFESEH /NXCOMPAT )
++        if (MSVC)
++            target_compile_options( ${target} PRIVATE /GS /DynamicBase)
++            if(BUILD_WITH_STATIC_CRT)
++                target_compile_options( ${target} PRIVATE "/MT")
++            endif()
++            if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
++                # These options for 32 bit builds only
++                target_compile_options( ${target} PRIVATE /SAFESEH /NXCOMPAT )
++            endif()
+         endif()
+     endif()
+ endfunction()

+ 8 - 1
packages/a/ade/xmake.lua

@@ -7,6 +7,9 @@ package("ade")
              "https://github.com/opencv/ade.git")
 
     add_versions("v0.1.2d", "edefba61a33d6cd4b78a9976cb3309c95212610a81ba6dade09882d1794198ff")
+    add_versions("v0.1.2", "ac2e6a4acbe6e0b0942418687ec37c6cd55dcaec5112c7ca09abefe6ee539499")
+
+    add_patches("0.1.2", "patches/0.1.2/cmake-mingw.patch", "59ac0ed938b82090e97de6dee358ba683b371908c3063b4d10146999a30eaaaa")
 
     add_deps("cmake")
 
@@ -19,5 +22,9 @@ package("ade")
     end)
 
     on_test(function (package)
-        assert(package:has_cxxtypes("ade::Graph", {configs = {languages = "c++11"}, includes = "ade/graph.hpp"}))
+        assert(package:check_cxxsnippets({test = [[
+            void test() {
+                ade::Graph x;
+            }
+        ]]}, {configs = {languages = "c++11"}, includes = "ade/graph.hpp"}))
     end)