Conversation
| scope = "config", | ||
| kind = "string", | ||
| allowed = { | ||
| "Off", |
There was a problem hiding this comment.
If it's just on/off, it should be a boolean and not a string.
There was a problem hiding this comment.
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.
I used linkgroups as 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.
Not checked if we can have boolean or string (for individual library).
|
|
||
| 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) |
There was a problem hiding this comment.
Is the path.translate issue something that you did indeed find to be a problem? Or is this pre-emptive?
There was a problem hiding this comment.
I encounter it in visual.
Using - as workaround is rejected in commandline though (as ninja).
I think we have to specify 'shell' and translate path here.
| @@ -0,0 +1,38 @@ | |||
| Apply whole archive flag to linked libraries. | |||
There was a problem hiding this comment.
Reword suggestion: Controls whether the linker should include all objects in the linked binary.
|
|
||
| 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) |
There was a problem hiding this comment.
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: link.exe foo.lib /WHOLEARCHIVE:foo.lib -- Following up on this, if we don't support granular whole archive, we can just have a single /WHOLEARCHIVE without specifying the individual libs.
There was a problem hiding this comment.
I might try that.
if we don't support granular
I hope to add that support.
What does this PR do?
Add
wholearchiveAPI which correspond to link option/WHOLEARCHIVE--whole-archiveof ld-force_loadHow does this PR change Premake's behavior?
Add an API
Anything else we should know?
Tested with https://github.com/Jarod42/premake-sample-projects/tree/wholearchive/projects/wholearchive
Did you check all the boxes?
closes #XXXXin comment to auto-close issue when PR is merged)