Use target_link_options to set -fuse-ld flag #6043
Merged
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.
This means that anything that transitively links to Realm::Storage will pick up this flag automatically. Due to how cmake handles target options, this will also be appended to the linker command line after anything set using add_link_options(), including the -fuse-ld=gold from our OpenSSL prebuilt.
I manually verified that if I point realm-js's submodule to this commit, it will start using lld for linking.
What, How & Why?
☑️ ToDos
[ ] 🚦 Tests (or not relevant)[ ] C-API, if public C++ API changed.