From a8461b0cf4a0ac12949ea428fc3435cbb0a15bce Mon Sep 17 00:00:00 2001 From: LostbBlizzard <106630000+LostbBlizzard@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:37:36 -0400 Subject: [PATCH 1/3] fixed defaultplatform not being selected when set --- ninja.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ninja.lua b/ninja.lua index a0f70c4..63b4385 100644 --- a/ninja.lua +++ b/ninja.lua @@ -160,14 +160,21 @@ function ninja.generateWorkspace(wks) table.insert(cfgs[cfg.buildcfg], key) -- set first configuration name - if (cfg_first == nil) and (cfg.kind == p.CONSOLEAPP or cfg.kind == p.WINDOWEDAPP) then - cfg_first = key + if wks.defaultplatform == "" then + if (cfg_first == nil) and (cfg.kind == p.CONSOLEAPP or cfg.kind == p.WINDOWEDAPP) then + cfg_first = key + end end if (cfg_first_lib == nil) and (cfg.kind == p.STATICLIB or cfg.kind == p.SHAREDLIB) then cfg_first_lib = key end if prj.name == wks.startproject then - cfg_first = key + if wks.defaultplatform == "" then + cfg_first = key + elseif cfg.platform == wks.defaultplatform then + cfg_first = key + break + end end -- include other ninja file From 9ea93a851cedd6c0993509f370e9e8fd3faeb19f Mon Sep 17 00:00:00 2001 From: LostbBlizzard <106630000+LostbBlizzard@users.noreply.github.com> Date: Fri, 18 Oct 2024 21:41:06 -0400 Subject: [PATCH 2/3] fixed bug --- ninja.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ninja.lua b/ninja.lua index 63b4385..2602c15 100644 --- a/ninja.lua +++ b/ninja.lua @@ -172,8 +172,9 @@ function ninja.generateWorkspace(wks) if wks.defaultplatform == "" then cfg_first = key elseif cfg.platform == wks.defaultplatform then - cfg_first = key - break + if cfg_first == nil then + cfg_first = key + end end end From e5131a5bb1848f490e9282fa76f99de8bb5918de Mon Sep 17 00:00:00 2001 From: LostbBlizzard <106630000+LostbBlizzard@users.noreply.github.com> Date: Sat, 26 Oct 2024 17:13:13 -0400 Subject: [PATCH 3/3] fixed wks.defaultplatform being nil and not "" --- ninja.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ninja.lua b/ninja.lua index 2602c15..2760af4 100644 --- a/ninja.lua +++ b/ninja.lua @@ -160,7 +160,7 @@ function ninja.generateWorkspace(wks) table.insert(cfgs[cfg.buildcfg], key) -- set first configuration name - if wks.defaultplatform == "" then + if wks.defaultplatform == nil then if (cfg_first == nil) and (cfg.kind == p.CONSOLEAPP or cfg.kind == p.WINDOWEDAPP) then cfg_first = key end @@ -169,7 +169,7 @@ function ninja.generateWorkspace(wks) cfg_first_lib = key end if prj.name == wks.startproject then - if wks.defaultplatform == "" then + if wks.defaultplatform == nil then cfg_first = key elseif cfg.platform == wks.defaultplatform then if cfg_first == nil then