Change: [CMake] Bump minimal version to 3.9 #8643
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.
Motivation / Problem
With CMake minimum version set to anything before 3.9, for some unknown reason (maybe vcpkg as it happens only for Windows and MacOS targets), CMP0069 policy is reset between CMake configuration and generation steps.
This triggers a CMake warning and cause INTERPROCEDURAL_OPTIMIZATION property to be ignored.
Description
Since IPO support detection and CMP0069 policy were introduced in 3.9, it's simpler to set the minimum CMake version and get working interprocedural optimisation.
CMake 3.7 introduced a FindICU module, but our own module is better. So I kept our own, with a notice about why we don't use CMake provided module.
I also updated
COMPILING.md
to indicate minimum CMake version, and some hints for MSVC users when libraries are installed but not found.Limitations
Some linux distribution may only have older CMake version as standard, but I think on most there's a way to update it.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.