You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the detect_compiler function(): string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) changes 6.0.0 to 6;0;0 list(GET VERSION_LIST 0 _COMPILER_VERSION) takes the 0th element of VERSION_LIST, so _COMPILER_VERSION is equal to 6
So an ERROR ERROR: Invalid setting '6' is not a valid value. 'settings.com piler. Version'.
There is indeed a gap in the version detection for Linux clang in cmake-conan.
As you can see the versioning approach in clang changed, and while the Conan settings contain X.0 for older versions, the newer versions are just the clang major. But cmake-conan mapping didn't implement it, and we didn't realize because clang 6 is nowadays a bit too old, so nobody was using it and nobody reported yet.
As you already did the investigation (good work, thanks!), would you like to contribute a PR yourself? The logic would be, for versions <8 include the minor, but only the major for >=8. Don't worry if you can't, we will try to fix it ourselves if not.
cmaker version: 3.24.0
conan version: 2.2.2
profiles/default
[settings]
os=Linux
arch=x86_64
compiler=clang
compiler.version=6.0
compiler.libcxx=libstdc++11
build_type=Release
Running cmake generates an error:
There is a detect_compiler() function in the conan_provider.cmake file
In the detect_compiler function():
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
changes6.0.0
to6;0;0
list(GET VERSION_LIST 0 _COMPILER_VERSION)
takes the 0th element of VERSION_LIST, so _COMPILER_VERSION is equal to6
So an ERROR
ERROR: Invalid setting '6' is not a valid value. 'settings.com piler. Version'
.Change the above two lines of code to the following line
This changes' 6.0.0 'to' 6.0 'and assigns' CMAKE_CXX_COMPILER_VERSION', which runs successfully.
Is there a bug here?
The text was updated successfully, but these errors were encountered: