This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][libcxxabi] Remove the unused CMake checks
ClosedPublic

Authored by phosek on May 28 2019, 8:25 PM.

Details

Summary

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.

Diff Detail

Event Timeline

phosek created this revision.May 28 2019, 8:25 PM

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

ldionne added inline comments.May 29 2019, 8:19 AM
libcxxabi/cmake/config-ix.cmake
52

Why are we keeping this one?

phosek marked an inline comment as done.May 29 2019, 8:37 AM
phosek added inline comments.
libcxxabi/cmake/config-ix.cmake
52

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

ldionne accepted this revision.May 29 2019, 9:25 AM
This revision is now accepted and ready to land.May 29 2019, 9:25 AM

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.

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.

This revision was automatically updated to reflect the committed changes.