premake-core
premake-core copied to clipboard
links broken on MacOS
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)
- [x] XCode (xcode)
- [ ] Codelite
- [ ] Other (Please list below)
What version of Premake are you using? 5.0.0-dev