These seemed to have been used in the past but were since replaced
by the add_compile_flags_if_supported function that combine these
these checks and adding the flag, but the original checks were never
removed.
Details
Diff Detail
- Repository
- rCXX libc++
Event Timeline
Alternative would be to avoid add_compile_flags_if_supported altogether and instead the combination of check_cxx_compiler_flag and append_if as is used in libunwind (https://github.com/llvm/llvm-project/blob/master/libunwind/CMakeLists.txt#L274). The advantage of the latter is that we could in theory have different config-ix.cmake files (e.g. pre-populated ones for the runtimes build).
libcxxabi/cmake/config-ix.cmake | ||
---|---|---|
52 ↗ | (On Diff #201815) | Why are we keeping this one? |
libcxxabi/cmake/config-ix.cmake | ||
---|---|---|
52 ↗ | (On Diff #201815) | It's the only one that's being used in CMakeLists.txt, see https://github.com/llvm/llvm-project/blob/master/libcxxabi/CMakeLists.txt#L264 |
Does anyone have any opinion on add_compile_flags_if_supported vs check_cxx_compiler_flag + append_if? If not I'm going to land this as is.
I have a strong preference for add_compile_flags_if_supported until we have the use case you described above. I'm not saying it's not a good/real use case, just that if we're not taking advantage of it right now, we should just simplify things.