feat: add support for toolset-provided extensions in msc.getlinks#2677
Open
ak-slongchamps wants to merge 1 commit intopremake:masterfrom
Open
feat: add support for toolset-provided extensions in msc.getlinks#2677ak-slongchamps wants to merge 1 commit intopremake:masterfrom
ak-slongchamps wants to merge 1 commit intopremake:masterfrom
Conversation
nickclark2016
approved these changes
Apr 29, 2026
Jarod42
approved these changes
Apr 30, 2026
nickclark2016
requested changes
Apr 30, 2026
| -- Then the system libraries, which come undecorated | ||
| local system = config.getlinks(cfg, "system", "fullpath") | ||
|
|
||
| local toolset = config.toolset(cfg) |
Member
There was a problem hiding this comment.
After sleeping on this and discussion with @samsinsane, we think it may make more sense to move the logic from msc.lua to the VS project generation file. This here is a bit smelly, since we are already in a toolset file.
Right now, VS is pretty hard coded to msc-isms. This may be a case where we want to be more agnostic in the VS exporter itself, loading in the specified toolset rather than just using MSC.
Contributor
Author
There was a problem hiding this comment.
Interesting, worth investigating. I'll put this on pause until I get access to the specific platform that requires this change on our side to validate this approach.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
When using clang or gcc as a native toolset in Visual Studio as a cross-compiler, libraries may have .a or .so as extensions, but currently .lib is appended to the lib's name in the linker arguments list, which results in e.g., Foo.a.lib, Bar.so.lib for Foo.a and Bar.so, respectively.
How does this PR change Premake's behavior?
We add the support for extensions that are typical of the toolsets on corresponding platforms and use them specifically in
msc.getlinksto supplement the list of extensions when the active toolset defines some.This only has an impact in the special case of a msc generated output with a non-msc toolset, typically for cross-compilation scenarios. Because we just add new extensions, it should not impact usages with clang-cl.
Anything else we should know?
Nope.
Did you check all the boxes?
closes #XXXXin comment to auto-close issue when PR is merged)You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!