Open crazydef opened 1 year ago
Also apply to gmake.
As I see, group
adds rules in makefile to build all projects of the group.
I haven't expected group to appear in Makefile, but ok...
Also apply to gmake.
This will be a non-fix unless the gmake and gmake2 group creation logic is shared.
As I see,
group
adds rules in makefile to build all projects of the group. I didn't expect group to appear in Makefile...
I fully expect compilation groups to be in makefile, as I can do things like optional projects and such with them (i.e. unit tests).
Just some further review on this. I don't think renaming the group in Premake is a valid option. Personally, I'm a fan of either a "wont fix" or a warning for when there are multiple nodes with the same name in the structure.
For me renaming the group in the my lua file is the easiest option. And it's what I did. For me, it's no biggie. (It's just a folder name in VS.)
But having some warning or error when running Premake would improve the UX and make it easier to debug things like this in the future. As I said, it took me ages to figure out what the actual problem was. (Which wasn't really a problem per se - just an annoying warning from make
when building.)
Actions to Take:
This could be done in either the core library or the gmake2 module. Correct location TBD.
As it is an issue only with gmake/gmake2, so check should be done in gmake/gmake2, IMO.
I guess the question is: Do we want this behavior to be consistent across all of premake, or do we want exporter-specific behavior?
The whole reason for Premake existing is to support multiple toolchains across different OSes/devices. It might seem a bit inconsistent if one reported this and the others didn't. (E.g., everything works on your initial platform and then you suddenly start getting warnings when you move to a second.)
What seems to be the problem? When groups are added to a workspace and they contain projects with the same name, the resulting makefile has circular dependencies.
The above snippet will generate this line in the makefile:
And make will output the following message:
This isn't a huge deal (I can just rename the group), but it took me ages to figure this out. So it might be nice to have a warning in Premake about such things, or even just dropping groups from gmake2. (They're an IDE construct after all. I don't know if they bring any value to makefiles.)
What did you expect to happen? I never know what to expect. :)
What have you tried so far? I renamed the group. It's no biggie, but maybe the UX could be improved.
How can we reproduce this? See the above snippet.
What version of Premake are you using? 5.0.0-dev