[libunwind] Refactor CMake flag checks to match libc++ and libc++abi
authorPetr Hosek <phosek@chromium.org>
Fri, 11 Oct 2019 22:22:29 +0000 (22:22 +0000)
committerPetr Hosek <phosek@chromium.org>
Fri, 11 Oct 2019 22:22:29 +0000 (22:22 +0000)
commit20da3bdb96c306c3e89d56039ffdeaf2bd41d737
tree2c44cf7950c07d417d23a73330bdf27355220a4d
parente2d104f64ca8f3b77888f218f0054c28c96a3975
[libunwind] Refactor CMake flag checks to match libc++ and libc++abi

libunwind was using its own set of macros/functions for flag checking
which was similar but different from libc++ and libc++abi. This made
it difficult to replicate the same checks across projects, in fact
there were some checks that appear to have been copy & pasted from
another project and that were broken in the standalone libunwind build.
This change refactors flag checks to match libc++ and libc++abi using
a copy of HandleLibunwindFlags.cmake which is derived from the versions
used by the other projects. This also paves a road to deduplicating and
unifying HandleLibunwindFlags.cmake, HandleLibcxxabiFlags.cmake and
HandleLibcxxFlags.cmake post monorepo switch.

Differential Revision: https://reviews.llvm.org/D68855

llvm-svn: 374606
libunwind/CMakeLists.txt
libunwind/cmake/Modules/HandleLibunwindFlags.cmake [new file with mode: 0644]
libunwind/cmake/config-ix.cmake
libunwind/src/CMakeLists.txt