I'm currently trying to see how easy it is to get premake to generate ninja files. Right now, I'm having a bit of an issue as I need to know what kinds of projects are being built when I'm creating the "solution" file.
I have a function that's bound to onsolution that's the following:
function premake.ninja_solution(sln)
local project_types = {}
for _, prj in ipairs(sln.projects) do
project_types[prj.kind] = true
end
end
The problem is that prj.kind is nil, when it should be "ConsoleApp" (as I'm using the premake4.lua file in the repository).
Why can I not access the "kind" attribute inside of the solution creation?

>Why can I not access the "kind" attribute inside of the solution creation?
Kind is per-configuration property, so it's better to retrieve it from configuration tables. Out of curiosity, why do you need it in onsolution, not onproject?
BTW, I'm planning to write a common abstraction layer for all make variants, including ninja, and use it to implement actions.
How do you access the configuration tables for each project when creating the solution?
The reason I want the "kind" property for every project inside of the solution is because I want to generate the top-level rules (such as cxx) only when necessary, and they can only be generated once. So I can't generate them in the projects (otherwise they may get generated multiple times) and I don't want to generate every rule that I could possibly need, so I need to know what kinds of projects are going to be built.
>How do you access the configuration tables for each project when creating the solution?
jsternberg: Have you made any progress on Ninja? If so, are you planning to share your code?
No, I haven't made any progress. I haven't been working on it since I didn't decide to use premake for anything.
Sorry.