-
-
Notifications
You must be signed in to change notification settings - Fork 618
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 with :static
suffix do not generate correct target dependencies
#1685
Comments
Could you attach the makefile that premake generates? |
Here is a zip archive of the Makefiles. |
The lib project lookup doesn't take into account :static or :shared in the lib name. https://gist.github.com/kevza/ec6a8c6f58019f367b50cc45f666d746 |
@samsinsane, @piotrdz and I work together on the same project. Our build is really, really complicated and there are a bunch of targets that get assembled with different linking requirements (Plugins v/s Applications etc..) so we have to use the :shared :static annotations depending on what the target is. We have added the patch I attached to our build of premake and everything is working as expected. |
@kevza Can you submit that as a PR? Otherwise, I'll create a PR after work. |
@samsinsane thank you for creating that PR. Apologies for not getting to it sooner. |
What seems to be the problem?
Given this sample project where
links
is used with:static
suffix to enable putting the static library in static section of link libraries (-Wl,-Bstatic
):When premake is called to generate gmake Makefiles, and make is invoked to build MyApp:
Then it fails to build with the compiler not finding the MyLib:
This is because MyApp in generated Makefiles does not include a dependency on MyLib target. Therefore, MyLib is never built and the linking phase of MyApp fails.
What did you expect to happen?
Generated Makefiles should contain the correct dependency of MyApp on MyLib and
make MyApp
should build first MyLib, then MyApp successfully.What have you tried so far?
The only workaround is to manually build MyLib first, then MyApp.
How can we reproduce this?
Run the example given above.
What version of Premake are you using?
premake5 (Premake Build Script Generator) 5.0.0-alpha16
Anything else we should know?
When not using the
:static
suffix, the dependencies are correct and the build works as expected:However, that is not a valid workaround for the project I am working on. In this particular case, putting the library in
-Wl,-Bstatic
section is quite important for building the project correctly.The text was updated successfully, but these errors were encountered: