premake-core icon indicating copy to clipboard operation
premake-core copied to clipboard

Using `includeexternal` with a script which uses a group will cause the previously declared project to not get generated

Open Tisten opened this issue 1 year ago • 0 comments

What seems to be the problem? I'm using premake to generate visual studio projects, and have several workspaces (creating solutions), some of which share the same libraries (projects). The libraries are grouped in subfolders in Visual Studio. Because of this setup I am using includeexternal to avoid the projects to get generated multiple times. So the first time I see a library I use include to create the project, and every time after that I use includeexternal.

The problem is that the project which is declared before an includeexternal gets marked as external if the script which is included declare a group before the first project it declares. Thus the non-external project never gets generated. I have created a reproduction case in the premake tests which I will create a pull request of.

What did you expect to happen? I expected a .vcxproj to be created for the non-external project, but it never happened because of the "group" inside of the includeexternal script.

What have you tried so far? My workaround is to move the group declaration to outside the includeexternal script, i.e. to the script which does the include.

How can we reproduce this? I've created a test for you. I will mention this issue in my Pull Request of that test.

  • [x] Visual Studio 2022 (vs2022)
  • [x] Visual Studio 2019 (vs2019)
  • [x] Visual Studio 2017 (vs2017)
  • [x] Visual Studio 2015 (vs2015)
  • [x] Visual Studio 2012 (vs2012)
  • [x] Visual Studio 2010 (vs2010)
  • [x] Visual Studio 2008 (vs2008)
  • [x] Visual Studio 2005 (vs2005)
  • [ ] GNU Makefile (gmake)
  • [ ] GNU Makefile 2 (gmake2)
  • [ ] XCode (xcode)
  • [ ] Codelite
  • [ ] Other (Please list below)

What version of Premake are you using? I'm using "head" of github.

Tisten avatar Sep 14 '22 17:09 Tisten