-
-
Notifications
You must be signed in to change notification settings - Fork 616
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
Implicit Linking for non-Visual Studio Exporters #2344
Comments
Visual Studio implicitly links all dependent projects together when you build a DLL or EXE. When you're using other exporters, you need to explicitly link transient project dependencies. |
I tried (https://github.com/Jarod42/premake-sample-projects/blob/implicit_link/projects/project-implicit_link):
And, indeed non-msvc generators fail to link with missing function from libB. |
I'm probably misinterpreting what the flag is for then. I'll rewrite the issue, but basically, I want to allow for linking of the entire project dependency chain implicitly. |
Looking into it, I'm not 100% sure if the flag is even working based on the description in the documentation. At least, it may not work at workspace scope and may need to be at project scope. |
What problem will this solve?
Currently, dependencies on projects will resolve in different behaviors between Visual Studio and other exporters. Currently, only VS support implicit transitive linking based on project dependencies. I propose that we expose that behavior across other exporters.
What might be a solution?
From a user perspective, I propose adding an API such as:
This would allow the user to specify whether or not to use the implicit linking functionality. By default, I would propose turning this on. Visual Studio already turns this on by default (see the
NoImplicitLinks
flag).In the generator, this would equate to performing a walk of the dependencies to get all static libraries and shared libraries to link to based on if they allow for implicit links. If implicit links are allowed on platforms that don't support implicit links directly, we would then emit rules in the generated files that specify the binary files to link against (and the appropriate linker search directories).
What other alternatives have you already considered?
Currently, the manual approach to this is to add all linkages manually to each project, ensuring that the behavior is consistent.
Anything else we should know?
Talking with various users across the community, this is something that would be useful to unify behavior across exporters.
The text was updated successfully, but these errors were encountered: