pull/4952/head
ruki 3 months ago committed by GitHub
parent 330616d122
commit 9fefb97834
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      packages/c/catch2/xmake.lua

@ -58,13 +58,6 @@ package("catch2")
link = link.."d"
end
component:add("links", link)
if package:is_plat("windows") then
if package:has_tool("cxx", "cl") then
component:add("ldflags", "-subsystem:console")
elseif package:has_tool("cxx", "clang", "clangxx") then
component:add("ldflags", "-Wl,/subsystem:console")
end
end
end)
on_component("lib", function (package, component)
@ -76,6 +69,15 @@ package("catch2")
end)
on_install(function (package)
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
if package:version():ge("3.0") then
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"))

Loading…
Cancel
Save