GENie
GENie copied to clipboard
objdir is relative, targetdir is absolute (and VS2019 icon)
Greetings,
I just saw this change: https://github.com/bkaradzic/GENie/pull/465 But is this now inconsistent between targetdir and objdir?
I expected targetdir and intdir to preserve the path I provided:
LUA project file:
targetdir "$(somepath)/bin/"
objdir "$(somepath)/obj/"
Generated .vcxproj file:
<OutDir>$(somepath)\bin\</OutDir>
<IntDir>$(somepath)\x64\Debug\MyProjectName\</IntDir>
Expected:
<IntDir>$(somepath)\obj\</IntDir>
I'll try using intDirAbsolute. I'm using latest VS2019 version 16.4.5.
Also, a minor fix for the Visual Studio 2019 icon (version 16). I had wanted for VS2019 to launch from the .sln file but alas the Visual Studio Selector must still select the version. I ended up with just a fix for the icon.
I'm not set up to create a PR on github yet, the change is to vstudio_solution.lua:
function sln2005.header(sln)
local action = premake.action.current()
_p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion)
if(_ACTION:sub(3) == "2015" or _ACTION:sub(3) == "2017") then
_p('# Visual Studio %s', action.vstudio.toolsVersion:sub(1,2))
elseif(_ACTION:sub(3) == "2019") then
_p('# Visual Studio Version %s', action.vstudio.toolsVersion:sub(1,2))
else
_p('# Visual Studio %s', _ACTION:sub(3))
end
end
I ran 'genie embed' to update scripts.c with the above then compiled genie.exe in msys2. I also tried compiling in mingw to avoid the msys-2.0.dll dependency but ran into 'uname' not being available, and 'mkdir' not being recursive. Is there a better way?
The extra relative path is being appended before the check for intDirAbsolute.
What I've done for now is change builduniquedirs in bake.lua:
cfg.objectsdir = path.getrelative(cfg.location, dir)
to
cfg.objectsdir = cfg.objdir
cc @DJLink
Hi.
So that behavior already existed before the intDirAbsolute fix for 2019. objdir was already adding the Configuration and Platform, for example "\x32\Release"
They can be both independently configured via objdir and targetdir, so they will match if both set to the same in the genie.lua.
However I think objdir behaviour and documentation doesn't match.
objdir
By default, object and intermediate files are stored in a directory named "obj" in the same directory as the project
But we are getting "/obj/x32/Debug" when we don't set anything to objdir, instead of just "obj" like documentation says.
As we can see OutDir matches what documentation says (when not configured) but IntDir no?
Any help on this part here @bkaradzic would be great.
As for the icon bug I made a PR that should fix: https://github.com/bkaradzic/GENie/pull/496
premake has an optional '!' prefix to override the appending of any paths, leaving the passed objdir as-is:
https://github.com/premake/premake-core/wiki/objdir
premake has an optional '!' prefix to override the appending of any paths, leaving the passed objdir as-is:
https://github.com/premake/premake-core/wiki/objdir
GEnie is a fork of Premake 4.4 so Premake 5+ features are possibly not here, unless someone added them, but would be cool if you could PR that into Genie based on Premake. I added one of 2 things from Premake myself in the past.
I could likely manage putting that in GENie. What is the driving motivation for GENie over premake? It sounds like premake wasn't being maintained for a while. Just this on the front page:
Initial version of GENie is fork of Premake 4.4 beta 5, and there is no intention to keep it compatible with it.
Is GENie just more active with more contributors? Send me a PM if this isn't public knowledge.
I'm working with premake now because of another issue: https://github.com/bkaradzic/GENie/issues/495