Skip to content

Commit

Permalink
Fix catch2 v2.x install failures (#5145)
Browse files Browse the repository at this point in the history
  • Loading branch information
ToeKneeRED authored Sep 5, 2024
1 parent c02fc3a commit 9691d52
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions packages/c/catch2/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 9691d52

Please sign in to comment.