Browse Source

update yoga to 3.1.0 (#4510)

* update yoga to 3.1.0

* add check

---------

Co-authored-by: star9029 <[email protected]>
c8ef 1 year ago
parent
commit
3960355cf8
1 changed files with 13 additions and 0 deletions
  1. 13 0
      packages/y/yoga/xmake.lua

+ 13 - 0
packages/y/yoga/xmake.lua

@@ -6,6 +6,7 @@ package("yoga")
     add_urls("https://github.com/facebook/yoga/archive/refs/tags/$(version).tar.gz",
              "https://github.com/facebook/yoga.git")
 
+    add_versions("v3.1.0", "06ff9e6df9b2388a0c6ef8db55ba9bc2ae75e716e967cd12cf18785f6379159e")
     add_versions("v3.0.4", "ef3ce5106eed03ab2e40dcfe5b868936a647c5f02b7ffd89ffaa5882dca3ef7f")
     add_versions("v3.0.3", "0ae44f7d30f8130cdf63e91293e11e34803afbfd12482fe4ef786435fc7fa8e7")
     add_versions("v3.0.2", "73a81c51d9ceb5b95cd3abcafeb4c840041801d59f5048dacce91fbaab0cc6f9")
@@ -16,6 +17,18 @@ package("yoga")
 
     add_deps("cmake")
 
+    if on_check then
+        on_check(function (package)
+            assert(package:check_cxxsnippets({test = [[
+                #include <bit>
+                void test() {
+                    constexpr double f64v = 19880124.0; 
+                    constexpr auto u64v = std::bit_cast<std::uint64_t>(f64v);
+                }
+            ]]}, {configs = {languages = "c++20"}}), "package(yoga) Require at least C++20.")
+        end)
+    end
+
     on_install(function (package)
         local configs = {}
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))