瀏覽代碼

update re2 to 2024.03.01 (#3445)

* update re2 to 2024.03.01

* update hash
c8ef 1 年之前
父節點
當前提交
b9bef4c8a3
共有 1 個文件被更改,包括 15 次插入39 次删除
  1. 15 39
      packages/r/re2/xmake.lua

+ 15 - 39
packages/r/re2/xmake.lua

@@ -11,56 +11,32 @@ package("re2")
     add_versions("2021.11.01", "8c45f7fba029ab41f2a7e6545058d9eec94eef97ce70df58e92d85cfc08b4669")
     add_versions("2022.02.01", "9c1e6acfd0fed71f40b025a7a1dabaf3ee2ebb74d64ced1f9ee1b0b01d22fd27")
     add_versions("2023.11.01", "4e6593ac3c71de1c0f322735bc8b0492a72f66ffccfad76e259fa21c41d27d8a")
+    add_versions("2024.03.01", "7b2b3aa8241eac25f674e5b5b2e23d4ac4f0a8891418a2661869f736f03f57f4")
 
-    add_deps("cmake")
+    add_deps("cmake", "abseil")
 
     if is_plat("linux") then
         add_syslinks("pthread")
     end
 
-    on_load(function (package)
-        if package:version():eq("2023.11.01") then
-            if not package:is_plat("macosx", "linux", "windows", "mingw", "cross") then
-                raise("re2 2023.11.01 only support macosx linux windows mingw cross")
-            end
-            package:add("deps", "abseil")
-        end
-    end)
-
-    on_install(function (package)
+    on_install("macosx", "linux", "windows", "mingw", "cross", function (package)
         local configs = {"-DRE2_BUILD_TESTING=OFF"}
-        if package:version():eq("2023.11.01") then
-            table.insert(configs, "-DCMAKE_CXX_STANDARD=17")
-        end
+        table.insert(configs, "-DCMAKE_CXX_STANDARD=17")
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         import("package.tools.cmake").install(package, configs)
     end)
 
     on_test(function (package)
-        if package:version():eq("2023.11.01") then
-            assert(package:check_cxxsnippets({test = [[
-                #include <string>
-                #include <cassert>
-                void test() {
-                    int i;
-                    std::string s;
-                    assert(RE2::FullMatch("ruby:1234", "(\\w+):(\\d+)", &s, &i));
-                    assert(s == "ruby");
-                    assert(i == 1234);
-                }
-            ]]}, {configs = {languages = "c++17"}, includes = "re2/re2.h"}))
-        else
-            assert(package:check_cxxsnippets({test = [[
-                #include <string>
-                #include <cassert>
-                void test() {
-                    int i;
-                    std::string s;
-                    assert(RE2::FullMatch("ruby:1234", "(\\w+):(\\d+)", &s, &i));
-                    assert(s == "ruby");
-                    assert(i == 1234);
-                }
-            ]]}, {configs = {languages = "c++11"}, includes = "re2/re2.h"}))
-        end
+        assert(package:check_cxxsnippets({test = [[
+            #include <string>
+            #include <cassert>
+            void test() {
+                int i;
+                std::string s;
+                assert(RE2::FullMatch("ruby:1234", "(\\w+):(\\d+)", &s, &i));
+                assert(s == "ruby");
+                assert(i == 1234);
+            }
+        ]]}, {configs = {languages = "c++17"}, includes = "re2/re2.h"}))
     end)