Fix catch2 v2.x install failures (#5145)

pull/5147/head
Anthony 3 months ago committed by GitHub
parent c02fc3aff6
commit 9691d528c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 21
      packages/c/catch2/xmake.lua

@ -67,19 +67,26 @@ package("catch2")
link = link.."d"
end
component:add("links", link)
end)
on_install(function (package)
if package:is_plat("windows") then
local main_component = package:component("main")
if package:is_plat("windows") and package:version():le("3.0") then
if package:has_tool("cxx", "cl") then
main_component:add("ldflags", "-subsystem:console")
component:add("ldflags", "-subsystem:console")
elseif package:has_tool("cxx", "clang", "clangxx") then
main_component:add("ldflags", "-Wl,/subsystem:console")
component:add("ldflags", "-Wl,/subsystem:console")
end
end
end)
on_install(function (package)
if package:version():ge("3.0") then
if package:is_plat("windows") then
local main_component = package:component("main")
if package:has_tool("cxx", "cl") then
main_component:add("ldflags", "-subsystem:console")
elseif package:has_tool("cxx", "clang", "clangxx") then
main_component:add("ldflags", "-Wl,/subsystem:console")
end
end
local configs = {"-DCATCH_INSTALL_DOCS=OFF", "-DCATCH_BUILD_TESTING=OFF", "-DCATCH_BUILD_EXAMPLES=OFF"}
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"))

Loading…
Cancel
Save