From 161d31a4e1c884495341601b82b5ae484e010c6d Mon Sep 17 00:00:00 2001 From: Glyn Leine Date: Sun, 10 Nov 2024 00:21:33 +0100 Subject: [PATCH] fix leaking of catch2 dep --- premake/rythe/projects.lua | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/premake/rythe/projects.lua b/premake/rythe/projects.lua index 66796cf46..6f09c1e47 100644 --- a/premake/rythe/projects.lua +++ b/premake/rythe/projects.lua @@ -124,11 +124,7 @@ local function kindName(projectType, config) elseif projectType == "editor" then return "SharedLib" elseif projectType == "application" then - if config == rythe.Configuration.RELEASE then - return "WindowedApp" - else - return "ConsoleApp" - end + return "ConsoleApp" elseif projectType == "library" then return "StaticLib" elseif projectType == "header-only" then @@ -386,19 +382,29 @@ local function getDepsRecursive(project, projectType) deps = {} end + local copy = utils.copyTable(deps) + if projectType == "test" then - deps[#deps + 1] = "third_party/catch2" - end + local containsCatch = false - local copy = utils.copyTable(deps) + for i, dep in ipairs(copy) do + if string.match(dep, "third_party/catch2") then + containsCatch = true + end + end + + if containsCatch == false then + copy[#copy + 1] = "third_party/catch2" + end + end local set = {} - for i, dep in ipairs(deps) do + for i, dep in ipairs(copy) do set[dep] = true end - for i, dep in ipairs(deps) do + for i, dep in ipairs(copy) do local assemblyId, scope = getDepAssemblyAndScope(dep) local depProject, depId, depType = findAssembly(assemblyId)