瀏覽代碼

teascript: add package (#3768)

* teascript: add package

* teascript: add configs

* teascript: set headeronly

* teascript: limit to windows, linux, macosx

* teascript: change limits

* teascript: change limits

* teascript: fix limit

* teascript: change limits

* teascript: change limits

* teascript: change limits

* teascript: combine limits

* teascript: fix limits

* teascript: enable macosx

* teascript: separate macosx

* teascript: change limit for macosx

* teascript: comment out

* teascript: fix ignore iphone

* teascript: ignore macosx x86_64

* teascript: make shorter ignore

* teascript: allow mingw

* teascript: ignore some mingw

* teascript: simpler limits

* teascript: allow mingw

* teascript: fix limit on mingw

* teascript: fix mingw

* teascript: ignore type of mingw

* teascript: allow mingw

* teascript: fix mingw

* Update mingw_macos.yml

* Update mingw_macos.yml

---------

Co-authored-by: ruki <[email protected]>
Chi Huu Huynh 1 年之前
父節點
當前提交
4caa3235d7
共有 2 個文件被更改,包括 39 次插入2 次删除
  1. 3 2
      .github/workflows/mingw_macos.yml
  2. 36 0
      packages/t/teascript/xmake.lua

+ 3 - 2
.github/workflows/mingw_macos.yml

@@ -11,11 +11,12 @@ jobs:
       matrix:
       matrix:
         os: [macOS-latest]
         os: [macOS-latest]
         kind: [static, shared]
         kind: [static, shared]
+        arch: [i386, x86_64]
 
 
     runs-on: ${{ matrix.os }}
     runs-on: ${{ matrix.os }}
 
 
     concurrency:
     concurrency:
-        group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-MingW-macOS-${{ matrix.kind }}
+        group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-MingW-macOS-${{ matrix.kind }}-${{ matrix.arch }}
         cancel-in-progress: true
         cancel-in-progress: true
     steps:
     steps:
       - uses: actions/checkout@v1
       - uses: actions/checkout@v1
@@ -30,5 +31,5 @@ jobs:
 
 
       - name: Tests
       - name: Tests
         run: |
         run: |
-          xmake l ./scripts/test.lua -D -p mingw -k ${{ matrix.kind }}
+          xmake l ./scripts/test.lua -D -p mingw -a ${{ matrix.arch }} -k ${{ matrix.kind }}
 
 

+ 36 - 0
packages/t/teascript/xmake.lua

@@ -0,0 +1,36 @@
+package("teascript")
+    set_kind("library", {headeronly = true})
+    set_homepage("https://tea-age.solutions/teascript/overview-and-highlights/")
+    set_description("TeaScript C++ Library - embedded scripting language for C++ Applications")
+    set_license("MPL-2.0")
+
+    add_urls("https://github.com/Florian-Thake/TeaScript-Cpp-Library/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/Florian-Thake/TeaScript-Cpp-Library.git")
+
+    add_versions("v0.13.0", "7c8cc05a8775ee2c857278b5e353670bf02442b2fa3a411343e82b2b85eedced")
+
+    add_configs("fmt", {description = "Use fmt for printing.", default = true, type = "boolean"})
+    add_configs("toml++", {description = "Enable toml support.", default = true, type = "boolean"})
+
+    on_load(function (package)
+        if package:config("fmt") then
+            package:add("deps", "fmt")
+        end
+        if package:config("toml++") then
+            package:add("deps", "toml++")
+        end
+    end)
+
+    on_install("windows", "linux", "macosx|arm64", "bsd", "msys", "mingw|i386", function (package)
+        os.cp("include", package:installdir())
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include "teascript/Engine.hpp"
+            void test() {
+                teascript::Engine engine;
+                engine.ExecuteCode("println(\"Hello, World!\");");
+            }
+        ]]}, {configs = {languages = "c++20"}}))
+    end)