Open Enhex opened 4 years ago
You can actually do this yourself, with no changes to Premake, by testing the host and calling vswhere from your system script.
Untested, but should be pretty close:
if not _ACTION then
if os.host() == 'windows' then
local ver, err = os.outputof('"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe" -latest -property productId')
_ACTION = 'vs' .. ver
elseif os.host() == 'macox' then
_ACTION = 'xcode4'
end
end
I'll leave this marked as Open since a "vs-latest" action could be useful. Not something that I'll be likely to get to, but would be happy to approve a pull request to add it!
What problem will this solve? I automatically call Premake on several projects, and currently I have the generator hardcoded into the script. Problem is I want to use a different generator per platform, or switch to a different generator, or use the latest Visual Studio generator.
What might be a solution? two part:
What other alternatives have you already considered? might be possible to do dirty hacks like using environment variables.