Browse Source

concerto-core (#7885)

* add concerto-core package with initial configuration and build scripts

* update concerto-core version to 2025.08.13+1

* update concerto-core version to 2025.08.13+2

* fix: disable android ndk >27

* update concerto-core version to 2025.08.13+3

* update concerto-core version to 2025.08.13+4

* fix: macosx-13 is not supported (because of C++20)

* fix: correct macOS version check for concerto-core

* fix: update macOS version check to require version >= 14 for concerto-core

* update: change concerto-core version to 2025.08.21 and remove shared library config
Arthur 3 weeks ago
parent
commit
f3a389bedb
1 changed files with 58 additions and 0 deletions
  1. 58 0
      packages/c/concerto-core/xmake.lua

+ 58 - 0
packages/c/concerto-core/xmake.lua

@@ -0,0 +1,58 @@
+package("concerto-core")
+    set_homepage("https://github.com/ConcertoEngine/ConcertoCore")
+    set_description("Concerto engine core library")
+    set_license("MIT")
+
+    add_urls("https://github.com/ConcertoEngine/ConcertoCore.git")
+
+    add_versions("2025.08.21", "836d4f6ab7a2c961520e692d55bbbc6ff0729b8f")
+
+    add_configs("asserts", {description = "Enable asserts.", default = false, type = "boolean"})
+    add_configs("enet", {description = "Enable ENet support.", default = false, type = "boolean"})
+
+    on_check("macosx", function (package)
+        assert(macos.version():ge("14"), "concerto-core requires version >= 14 for macOS")
+    end)
+
+    on_check("android", function (package)
+        local ndk = package:toolchain("ndk"):config("ndkver")
+        assert(ndk and tonumber(ndk) >= 27, "concerto-core require ndk version >= 27")
+    end)
+
+    on_load(function (package)
+        if package:config("enet") then
+            package:add("deps", "enet")
+        end
+    end)
+
+    on_install(function (package)
+        if package:has_tool("cxx", "cl", "clang_cl") then
+            package:add("cxxflags", "/Zc:preprocessor")
+        end
+        if not package:config("shared") then
+            package:add("defines", "CCT_CORE_LIB_STATIC")
+        end
+
+        local configs = {}
+        configs.tests = false
+        configs.mode = package:is_debug() and "debug" or "release"
+        configs.override_runtime = false
+        configs.asserts = package:config("asserts")
+        configs.enet = package:config("enet")
+
+        import("package.tools.xmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <string>
+            #include <Concerto/Core/Types.hpp>
+            #include <Concerto/Core/Result.hpp>
+            #include <Concerto/Core/DynLib.hpp>
+            void test() {
+                cct::Result<cct::Int32, std::string> result(28);
+                cct::DynLib lib;
+                bool ok = lib.IsLoaded();
+            }
+        ]]}, {configs = {languages = "c++20"}}))
+    end)