[backport 3.3] cmake: fix LTO build on Fedora #11521
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 PR is a backport of #11509 to
release/3.3
to a future3.3.3
release.)This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0"). Since version 3.4, CMake doesn't add flags to export symbols from executables without the ENABLE_EXPORTS target property, see CMP0065 1 for details. Without this property, some unit C tests produce build warnings with LTO optimization enabled (for example, on Fedora 39):
NO_WRAP
NO_WRAP
The CMP0065 is removed from CMake version 4.0 2. Thus, this patch fixes the behaviour by setting the property
ENABLE_EXPORTS
for unit tests directly.NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build
Originally observed on 2.11, see this CI run. But may be reproduced on the master branch with the following Dockerfile:
In the Docker: clone the Tarantool repo and build with the following command: