Browse Source

Add reflex package (#4040)

* add poco 1.13.3

* add poco 1.13.3 git

* Update xmake.lua

* add reflex packages

* update reflex

add test and delete libreflex

* reflex platform test

* change test

* add reflex

* Update xmake.lua

* rename dir

* remove unused code

* Delete xmake.lua

* set to option

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

---------

Co-authored-by: star9029 <[email protected]>
Co-authored-by: ruki <[email protected]>
Tab Ye 1 year ago
parent
commit
e404e5cf5e
1 changed files with 44 additions and 0 deletions
  1. 44 0
      packages/r/re-flex/xmake.lua

+ 44 - 0
packages/r/re-flex/xmake.lua

@@ -0,0 +1,44 @@
+package("re-flex")
+    set_homepage("https://www.genivia.com/doc/reflex/html")
+    set_description("A high-performance C++ regex library and lexical analyzer generator with Unicode support.")
+    set_license("BSD-3-Clause")
+
+    add_urls("https://github.com/Genivia/RE-flex/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/Genivia/RE-flex.git")
+
+    add_versions("v4.3.0", "1658c1be9fa95bf948a657d75d2cef0df81b614bc6052284935774d4d8551d95")
+
+    on_install(function (package)
+        io.writefile("xmake.lua",[[
+            add_rules("mode.debug", "mode.release")
+            set_languages("cxx11")
+            add_includedirs("include")
+            set_encodings("utf-8")
+            add_vectorexts("all")
+
+            target("re-flex")
+                set_kind("$(kind)")
+                add_headerfiles("include/(reflex/*.h)")
+                add_files("lib/*.cpp")
+                add_files("unicode/*.cpp")
+                if is_plat("windows") and is_kind("shared") then
+                    add_rules("utils.symbols.export_all", {export_classes = true})
+                end
+
+            target("reflex")
+                set_kind("binary")
+                add_files("src/*.cpp")
+                add_deps("re-flex")
+        ]])
+        import("package.tools.xmake").install(package)
+        package:addenv("PATH", "bin")
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <reflex/matcher.h>
+            void test() {
+                reflex::Matcher matcher("\w+","114 514 1919 810");
+            }
+        ]]}, {configs = {languages = "cxx11"}}))
+    end)