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

links broken on MacOS #2232

Open
1 of 13 tasks
crazydef opened this issue Jul 31, 2024 · 1 comment
Open
1 of 13 tasks

links broken on MacOS #2232

crazydef opened this issue Jul 31, 2024 · 1 comment
Labels

Comments

@crazydef
Copy link

What seems to be the problem?
I have a workspace with multiple shared library projects and multiple applications.

As you would expect, each project has multiple configurations:

configurations
{
  "Debug",
  "Release",
  etc...
}

The output from each project has the configuration as part of the name:

targetsuffix ".%{cfg.buildcfg}"

The applications use dependson and links to setup build dependencies and linker inputs.

However, when using links as follows:

links
{
  "A",
}

Xcodebuild only ever attempts to use the Debug build of a library, regardless of the configuration actually being built.

clang: error: no such file or directory: '/Users/james/Work/KDI/Projects/Test/Release/libA.Debug.dylib'

To work around this, it is necessary to specify the entire library name in the links setting:

links
{
  "A.%{cfg.buildcfg}",
}

The documentation for links says:

When linking against another project in the same workspace, specify the project name here, rather than the library name. Premake will figure out the correct library to link against for the current configuration, and will also create a dependency between the projects to ensure a proper build order.

For Windows (vs2022) and Linux (gmake2) the above appears to be correct. However, this is not the case on MacOS.

Related to this, it appears build dependencies are also not set correctly on any platform, (I must use both links and depends) but that could be a consequence of needing to specify the full library name.

What did you expect to happen?
I expected MacOS to work the same as other platforms.

How can we reproduce this?
Test.zip

Unzip the attached, and run the following commands to reproduce the issue:

premake5 xcode4
xcodebuild -verbose -project X.xcodeproj -configuration Release build
  • Visual Studio 2022 (vs2022)
  • Visual Studio 2019 (vs2019)
  • Visual Studio 2017 (vs2017)
  • Visual Studio 2015 (vs2015)
  • Visual Studio 2012 (vs2012)
  • Visual Studio 2010 (vs2010)
  • Visual Studio 2008 (vs2008)
  • 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?
5.0.0-dev

@crazydef crazydef added the bug label Jul 31, 2024
@crazydef
Copy link
Author

Possibly related, I also see these warnings from xcode when building:

2024-07-31 10:07:33.155 xcodebuild[99013:2054129] warning:  The file reference for "A.xcodeproj" is a member of multiple groups ("Projects" and "Projects"); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
2024-07-31 10:07:33.155 xcodebuild[99013:2054129] warning:  The file reference for "B.xcodeproj" is a member of multiple groups ("Projects" and "Projects"); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
2024-07-31 10:07:33.170 xcodebuild[99013:2054129] warning:  The file reference for "A.xcodeproj" is a member of multiple groups ("Projects" and "Projects"); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.

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

No branches or pull requests

1 participant