From f4e873870f4b166987a171ac993e51779941d5d8 Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 2 Jul 2024 22:22:43 +0800 Subject: [PATCH] algo_plus: add package (#4540) --- packages/a/algo_plus/xmake.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/a/algo_plus/xmake.lua diff --git a/packages/a/algo_plus/xmake.lua b/packages/a/algo_plus/xmake.lua new file mode 100644 index 000000000..3c25d7958 --- /dev/null +++ b/packages/a/algo_plus/xmake.lua @@ -0,0 +1,27 @@ +package("algo_plus") + set_kind("library", {headeronly = true}) + set_homepage("https://csrt-ntua.github.io/AlgoPlus") + set_description("AlgoPlus is a C++17 library for complex data structures and algorithms") + set_license("Apache-2.0") + + add_urls("https://github.com/CSRT-NTUA/AlgoPlus.git") + add_versions("2024.07.02", "1287dfc5bf666bace15af9c14d03e807b71efa82") + + add_deps("nlohmann_json") + + on_install(function (package) + for _, file in ipairs(os.files("src/**.h")) do + io.replace(file, "../../../../third_party/json.hpp", "nlohmann/json.hpp", {plain = true}) + end + os.cp("src/*", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + std::vector > data; + int CLUSTERS; + kmeans a(data, CLUSTERS); + } + ]]}, {configs = {languages = "c++17"}, includes = {"machine_learning/clustering/kmeans/kmeans.h"}})) + end)