Skip to content

Commit

Permalink
fixed defaultplatform not being selected when set
Browse files Browse the repository at this point in the history
  • Loading branch information
LostbBlizzard committed Oct 19, 2024
1 parent 9bb7911 commit a8461b0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ninja.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8461b0

Please sign in to comment.