[cmake] remove custom CheckCXXCompileFlag.cmake macro - #23218
Open
linev wants to merge 1 commit into
Open
Conversation
ROOT was maintaing own copy of CheckCXXCompileFlag.cmake from year 2011 Meanwhile `cmake` 3.20 and higher provides much better version which covers many other compilers with their error output. So reason there is no reason for maintain our own version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ROOT was maintain own copy of
CheckCXXCompileFlag.cmakefrom year 2011Meanwhile
cmake3.20 and higher provides much better version which covers many other compilers with their error output. So there is no reason for maintain our own versionOne more reason to remove it - cmake 4.4 produces warning about usage of backslashes in the REGEX.
Some more info from Claude:
for a CMake ≥ 3.20 baseline, the stock module should be functionally equivalent (or better) than ROOT's bundled copy — the original reason for ROOT carrying its own version has effectively been absorbed upstream.
Here's the comparison:
ROOT's custom CheckCXXCompilerFlag.cmake (the version I found) is a 2011-era fork of the old Kitware module. Its whole reason for existing was an extended FAIL_REGEX list to catch compilers that print a warning and exit 0 on a bad flag instead of failing outright — with patterns for GNU, Clang, MSVC, Intel, HP, SunPro, XL/AIX, and PGI.
Stock CMake's module now delegates its regex list to a shared helper, CMakeCheckCompilerFlagCommonPatterns.cmake, included via CHECK_COMPILER_FLAG_COMMON_PATTERNS. That file's pattern set is actually broader than ROOT's own: