mbedtls
mbedtls copied to clipboard
Use CMAKE_C_SIMULATE_ID when available to determine compiler
Description
Enable mbed-tls to be build using cmake using clang-cl. Clang-cl is used when cross compiling from Linux to target Windows using xwin.
Additionaly removed a superfluous check on the clang-compiler ID.
Fixes #8387
PR checklist
- [x] changelog not required I think?
- [ ] 3.6 backport. Required
- [ ] 2.28 backport. Not required
- [x] tests not required, no functional code changes. And no infrastructure available to create a test to compile using xwin.
Notes for the submitter
Please refer to the contributing guidelines, especially the checklist for PR contributors.
@yanesca what else needs to happen to get this merged?
@daantimmer it needs approval from a second reviewer.
Is that a case of "hope some other reviewer sees this". Or do we have to assign/poke someone specific?
Do we want to backport this to 3.6? Letting CMakeLists.txt
diverge this early on in the LTS lifetime is likely to lead to problems later on.
Is that a case of "hope some other reviewer sees this". Or do we have to assign/poke someone specific?
Not anymore, @tom-daubney-arm will be reviewing it.
Do we want to backport this to 3.6? Letting CMakeLists.txt diverge this early on in the LTS lifetime is likely to lead to problems later on.
Yes, we do (when I originally reviewed this, we didn't have 3.6).
I've updated the description with the backport requirements
I am a little concerned that the documentation of CMAKE_<LANG>_SIMULATE_ID
doesn't match the description of CMAKE_C_SIMULATE_ID
above.
The documentation says
Some compilers simulate other compilers to serve as drop-in replacements. When CMake detects such a compiler it sets this variable to what would have been the CMAKE_<LANG>_COMPILER_ID for the simulated compiler.
In other words, this variable describes the ABI compatibility of the generated code
Whereas my understanding of the above (and the behaviour of clang-cl on Windows under VS) is that it would be the command-line interface of the compiler.
@paul-elliott-arm Do you have any knowledge here?
I have not seen this used before, but this seems fine to me, albeit as you say, a little confusing in the way they word things.