Skip to content

Commit

Permalink
Update xmake.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing authored Nov 8, 2024
1 parent 6cf0693 commit cb05756
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/l/lunasvg/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit cb05756

Please sign in to comment.