From 393b21c8e41e436e666b13d2d37126274095235c Mon Sep 17 00:00:00 2001 From: Chi Huu Huynh <73843190+Chi-EEE@users.noreply.github.com> Date: Fri, 16 Aug 2024 02:53:36 +0100 Subject: [PATCH] isocline: remove limits (#4945) --- packages/i/isocline/xmake.lua | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/i/isocline/xmake.lua b/packages/i/isocline/xmake.lua index 5f2fd5a78..84835a624 100644 --- a/packages/i/isocline/xmake.lua +++ b/packages/i/isocline/xmake.lua @@ -4,26 +4,38 @@ package("isocline") set_license("MIT") add_urls("https://github.com/daanx/isocline.git") + add_versions("2022.01.16", "762717b5acc7d8baf64faeb5320ae4b85cf98aac") add_deps("cmake") - on_install("linux", "macosx", "bsd", "mingw", "windows", function (package) + on_install(function (package) + io.replace("src/completers.c", "__finddata64_t", "_finddatai64_t", {plain = true}) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") and package:config("shared") then table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") end + import("package.tools.cmake").build(package, configs, {buildir = "build"}) + os.cp("include", package:installdir()) - os.trycp("build/*.a", package:installdir("lib")) - os.trycp("build/*.dylib", package:installdir("lib")) - os.trycp("build/*.so", package:installdir("lib")) - os.trycp("build/*.lib", package:installdir("lib")) - os.trycp("build/*.dll", package:installdir("bin")) + + os.trycp("build/**.a", package:installdir("lib")) + os.trycp("build/**.dylib", package:installdir("lib")) + os.trycp("build/**.so", package:installdir("lib")) + os.trycp("build/**.lib", package:installdir("lib")) + os.trycp("build/**.dll", package:installdir("bin")) end) on_test(function (package) - assert(package:has_cfuncs("ic_set_history", {includes = "isocline.h"})) + assert(package:check_cxxsnippets({test = [[ + void test() { + ic_set_history("history.txt", 100); + } + ]]}, {configs = {languages = "c++11"}, includes = "isocline.h"})) end)