Enable whole-program optimization when compiling eSpeak-NG #17631
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.
Link to issue number:
Closes #17623
Summary of the issue:
As for now, whole-program optimization for eSpeak-NG is intentionally turned off.
This was introduced in commit cf0443b when MSVC 2012 was used to compile eSpeak.
Enabling whole-program optimization can make the eSpeak DLL more efficient and smaller, from 637 KiB to 624 KiB.
It can also solve the problem of using a dynamically linked version of Sonic without
__declspec(dllimport)
in the header, because the optimization will be performed by the linker, if whole-program optimization is enabled.Description of user facing changes
None.
Description of development approach
Enable whole-program optimization by removing the
/GL-
option.Testing strategy:
I tried the klatt4 variant, but couldn't notice the difference between enabling and disabling the whole-program optimization. In fact, the waveforms generated are exactly the same.
Known issues with pull request:
None.
Code Review Checklist:
@coderabbitai summary