From cb057560f2e0d39efe0a81d9b24b32f1dc968f42 Mon Sep 17 00:00:00 2001 From: star9029 Date: Fri, 8 Nov 2024 23:46:42 +0800 Subject: [PATCH] Update xmake.lua --- packages/l/lunasvg/xmake.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/l/lunasvg/xmake.lua b/packages/l/lunasvg/xmake.lua index 29717a93b10..c316cf89b5c 100644 --- a/packages/l/lunasvg/xmake.lua +++ b/packages/l/lunasvg/xmake.lua @@ -13,9 +13,14 @@ package("lunasvg") add_versions("v2.3.5", "350ff56aa1acdedefe2ad8a4241a9fb8f9b232868adc7bd36dfb3dbdd57e2e93") add_deps("cmake") + add_deps("plutovg") on_load("windows", "mingw", function (package) local version = package:version() + if package:gitref() or version:ge("3.0.0") then + package:add("includedirs", "include/lunasvg") + end + if package:gitref() or version:ge("2.4.1") then if not package:config("shared") then package:add("defines", "LUNASVG_BUILD_STATIC") @@ -28,10 +33,17 @@ package("lunasvg") end) on_install(function (package) - local configs = {} + io.replace("CMakeLists.txt", "FetchContent_MakeAvailable(plutovg)", "find_package(plutovg)", {plain = true}) + + local configs = {"-DLUNASVG_BUILD_EXAMPLES=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) + + if package:is_plat("windows") and package:is_debug() then + local dir = package:installdir(package:config("shared") and "bin" or "lib") + os.trycp(path.join(package:buildir(), "lunasvg.pdb"), dir) + end end) on_test(function (package)