Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

objdir is relative, targetdir is absolute (and VS2019 icon) #494

Open
greenkalx opened this issue Mar 1, 2020 · 6 comments
Open

objdir is relative, targetdir is absolute (and VS2019 icon) #494

greenkalx opened this issue Mar 1, 2020 · 6 comments

Comments

@greenkalx
Copy link

greenkalx commented Mar 1, 2020

Greetings,

I just saw this change: #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.

visualstudio_icons_2017_2019

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?

@greenkalx
Copy link
Author

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

@bkaradzic
Copy link
Owner

cc @DJLink

@DJLink
Copy link
Contributor

DJLink commented Mar 1, 2020

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.

image

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: #496

@greenkalx
Copy link
Author

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

@DJLink
Copy link
Contributor

DJLink commented Mar 3, 2020

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.

@greenkalx
Copy link
Author

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: #495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@DJLink @bkaradzic @greenkalx and others