From e404e5cf5e4f8e8f2775d946a5e9e66dba21a7c9 Mon Sep 17 00:00:00 2001 From: Tab Ye <135727531+TabNahida@users.noreply.github.com> Date: Sat, 18 May 2024 12:20:02 +0800 Subject: [PATCH] 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 Co-authored-by: ruki --- packages/r/re-flex/xmake.lua | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 packages/r/re-flex/xmake.lua diff --git a/packages/r/re-flex/xmake.lua b/packages/r/re-flex/xmake.lua new file mode 100644 index 000000000..c150785f8 --- /dev/null +++ b/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 + void test() { + reflex::Matcher matcher("\w+","114 514 1919 810"); + } + ]]}, {configs = {languages = "cxx11"}})) + end)