mbedtls icon indicating copy to clipboard operation
mbedtls copied to clipboard

Use CMAKE_C_SIMULATE_ID when available to determine compiler

Open daantimmer opened this issue 1 year ago • 8 comments

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.

daantimmer avatar Oct 18 '23 14:10 daantimmer

@yanesca what else needs to happen to get this merged?

daantimmer avatar May 06 '24 12:05 daantimmer

@daantimmer it needs approval from a second reviewer.

yanesca avatar May 07 '24 07:05 yanesca

Is that a case of "hope some other reviewer sees this". Or do we have to assign/poke someone specific?

daantimmer avatar May 07 '24 07:05 daantimmer

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.

tom-cosgrove-arm avatar May 07 '24 07:05 tom-cosgrove-arm

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).

yanesca avatar May 07 '24 07:05 yanesca

I've updated the description with the backport requirements

tom-cosgrove-arm avatar May 07 '24 08:05 tom-cosgrove-arm

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?

tom-cosgrove-arm avatar May 08 '24 08:05 tom-cosgrove-arm

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.

paul-elliott-arm avatar May 08 '24 13:05 paul-elliott-arm