-
-
Notifications
You must be signed in to change notification settings - Fork 646
[feature] Add wholearchive
#2602
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -466,6 +466,11 @@ | |
| table.insert(links, link) | ||
| end | ||
|
|
||
| if cfg.wholearchive == p.ON then | ||
| -- Don't use "/WHOLEARCHIVE" as path.translate might be applied to result | ||
| links = table.translate(links, function (s) return "-WHOLEARCHIVE:" .. s end) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I encounter it in visual.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, this should probably go into the linker flags, rather than the getlinks functionality. Also, I think the proper way to do this would be:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might try that.
|
||
| end | ||
|
|
||
| return links | ||
| end | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| Apply whole archive flag to linked libraries. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reword suggestion: |
||
| That would include all their symbols. | ||
|
|
||
| ```lua | ||
| wholearchive "value" | ||
| ``` | ||
|
|
||
| ### Parameters ### | ||
|
|
||
| `value` is one of: | ||
|
|
||
| | Value | Description | | ||
| |---------|---------------------------------------------------| | ||
| | On | Turn on whole archive. | | ||
| | Off | Turn off whole archive. | | ||
|
|
||
| ### Availability ### | ||
|
|
||
| Premake 5.0-beta8 or later. | ||
|
|
||
| ### Examples ### | ||
|
|
||
| ```lua | ||
| project 'some_library' | ||
| kind 'StaticLib' | ||
| defines { 'MAKING_DLL_LIB' } -- for dllexport | ||
| -- .. | ||
| project 'some_dll' | ||
| kind 'SharedLib' | ||
| defines { 'MAKING_DLL_LIB' } -- for dllexport | ||
| links { 'some_library' } | ||
| wholearchive 'On' | ||
| -- .. | ||
| ``` | ||
|
|
||
| ### See Also ### | ||
|
|
||
| * [links](links.md) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's just on/off, it should be a boolean and not a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably have "Default" as well, because we should probably allow users to specify to use the default toolset/exporter behavior, rather than enforcing one behavior or another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used
linkgroupsas model :-/Ideally, I wanted libraries as well, but too lazy to do it, so currently an all or nothing.
Implementation would be more "On" or "Default" BTW :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not checked if we can have
booleanorstring(for individual library).