AppleClang identification dependes on CMP0025
See original GitHub issueIdentification of AppleClang
compiler in CMAKE_CXX_COMPILER_ID
depends on CMP0025 being set to NEW
.
However the default behavior is OLD
Unlike most policies, CMake version 3.0.2 does not warn by default when this policy is not set and simply uses OLD behavior. See documentation of the CMAKE_POLICY_WARNING_CMP0025 variable to control the warning.
To help detect this issue cmake-conan
should enable the CMAKE_POLICY_WARNING_CMP0025
flag and/or check the value of CMP0025
policy on Mac builds. Also note that this policy must be set before the project
declaration.
Otherwise we just get this error
ERROR: Invalid setting '7.0' is not a valid 'settings.compiler.version' value.
Possible values are ['3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9']
because it is identified as Clang
instead of AppleClang
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
CMP0025 — CMake 3.25.1 Documentation
Compiler id for Apple Clang is now AppleClang . CMake 3.0 and above recognize that Apple Clang is a different compiler than upstream...
Read more >#53201 (cmake: doesn't recognize macports-clang (No known ...
I was a bit too enthusiastic: setting CMP0025 on the commandline can still be undone by a cmake_minimum_required(VERSION x) with x < 3.0...
Read more >Clang Compiler User's Manual - Apple Open Source
The mapping of category names to category id's can be obtained by running 'clang --print-diagnostic-categories'. Controlling Diagnostics via Command Line Flags.
Read more >Remove the deprecated QDirModel - Qt Code Review
Change-Id: I7818ecd8f849eb566ac176612f382e17a0471c47 Reviewed-by: Lars ... .app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -o ...
Read more >CMake 3.14 not detecting AppleCLang in MacOS Mojave + ...
(Also read about policy CMP0025 but in this simple test I'm not using it. ... The C compiler identification is AppleClang 10.0.0.10001145 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Done it. I have also added CI with travis-ci for both Linux and OSX, and it seems the approach is running fine. A message outputs:
It is already merged in master, I am going to tag this too. Please try it and report, re-open issue if something fails, or have any question. Thanks!
Hi @kolis
I see, thanks! The only issue is that I think that it is not possible for
conan.cmake
to set it. Note how it is used:but as you said, and the docs clearly state, the policy MUST be set before the project declaration:
There is nothing in the
conan.cmake
file we provide that could make cmake understand that it is the AppleClang compiler. I guess the only way is to document it, any other idea or suggestion?As a side note, I have to admit that I am not a big fan of this cmake-conan project, because of this kind of issues, I think it is much better to call conan directly, or to have python scripts that orchestrate the build, calling the necessary tools (conan, cmake, or others), much better scripting in python than having to script in cmake. There are already 300 lines of cmake code, just to avoid a single direct
conan install
command. Just my personal opinion.