Repository navigation
Replace name-based clang detection with CMAKE_CXX_COMPILER_ID - #9674
Merged
Merged
Conversation
CMAKE_COMPILER_IS_CLANG was set by matching "clang" in the C compiler's executable name, which misses clang installations named cc/c++ (e.g. FreeBSD base) or versioned names like clang23 (rdkit#9662). The two bison warning suppressions in SmilesParse/SLNParse used only this variable and had no fallback, so they never applied under a differently-named clang. CMAKE_CXX_COMPILER_ID is computed by running the compiler and matching its version output, so it identifies clang under any executable name. All use sites now test it directly and the custom variable is removed, which also resolves rdkit#9663's question about the redundant double check.
Contributor
|
greglandrum
approved these changes
Oct 10, 2026
greglandrum
left a comment
Member
There was a problem hiding this comment.
LGTM.
Thanks for the contribution @barlowa124
Member
|
@yurivict the changes here look good to me, but I don't have a FreeBSD system. Could you please take a look and see if these resolve the problems you were seeing? |
greglandrum
pushed a commit
that referenced
this pull request
Nov 5, 2026
CMAKE_COMPILER_IS_CLANG was set by matching "clang" in the C compiler's executable name, which misses clang installations named cc/c++ (e.g. FreeBSD base) or versioned names like clang23 (#9662). The two bison warning suppressions in SmilesParse/SLNParse used only this variable and had no fallback, so they never applied under a differently-named clang. CMAKE_CXX_COMPILER_ID is computed by running the compiler and matching its version output, so it identifies clang under any executable name. All use sites now test it directly and the custom variable is removed, which also resolves #9663's question about the redundant double check. Co-authored-by: barlowa124 <[email protected]>
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.
Reference Issue
Fixes #9662 and resolves #9663.
What does this implement/fix? Explain your changes.
CMAKE_COMPILER_IS_CLANGwas detected by matchingclanginside theCMAKE_C_COMPILERpath, so a differently-named clang is missedentirely. FreeBSD's base
cc/c++and the packagedclang/clang++suffixed names both fall outside the match.
The
BOOST_SYSTEM_NO_DEPRECATEDsite had aCMAKE_CXX_COMPILER_IDfallback (the double-check #9663 asks about) but the bison warning
suppressions in
SmilesParse/SLNParsetested the custom variablealone and silently never applied.
All four sites now match
CMAKE_CXX_COMPILER_ID MATCHES "Clang"directly and the custom variable is deleted. CMake derives the ID by
running the compiler, so detection no longer depends on the executable
name, and the #9663 fallback becomes redundant.
MATCHES "Clang"alsocovers
AppleClang.CMAKE_COMPILER_IS_EMCCis untouched.Any other comments?
cmake ..reconfigures cleanly under AppleClang 17, exercisingthe changed conditions. No
CMAKE_COMPILER_IS_CLANGreferencesremain. The fix relies on CMake's compiler-ID detection rather than a
FreeBSD install. The
cc --versionoutput quoted in #9662 containsthe
FreeBSD clang versionstring the check matches.