[cmake] Add MINGW_LIBRARIES to the linker flags
authorMartin Storsjo <martin@martin.st>
Tue, 14 Aug 2018 06:13:36 +0000 (06:13 +0000)
committerMartin Storsjo <martin@martin.st>
Tue, 14 Aug 2018 06:13:36 +0000 (06:13 +0000)
commitf128f27874642c246c89de6adb830fde989edeb7
tree2e05c5067c2ef507e1fe4e85c06d0d941f293218
parent54fc3767fcfd29eadd58ed5c3fad5e18d7724c89
[cmake] Add MINGW_LIBRARIES to the linker flags

This is essential when building with -nodefaultlibs.

In some CMake versions (noticed in 3.5.1), the same libraries are
picked up from CMAKE_REQUIRED_LIBRARIES in some exceptional situations
(if CXX probing failed, due to libc++ not being built yet, the libraries
from CMAKE_REQUIRED_LIBRARIES are used for linking the target library),
but not at all in other newer CMake versions (3.10).

This is similar to what already is done in libcxxabi in SVN r302760
and libcxx in SVN r312498.

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

llvm-svn: 339642
libunwind/src/CMakeLists.txt