summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-08-14 06:13:36 +0000
committerMartin Storsjo <martin@martin.st>2018-08-14 06:13:36 +0000
commit0297c296a901fad02888040d1c80237fbeed3649 (patch)
tree4c5380242075c39fde63132a48fd8700e8ce3bca
parent1e73ceedf467eebae88c3f560c680cee3c527f24 (diff)
downloadlibunwind_llvm-0297c296a901fad02888040d1c80237fbeed3649.tar.gz
[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 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@339642 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--src/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 937159e..7a737ef 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -62,6 +62,9 @@ append_if(LIBUNWIND_CXX_FLAGS LIBUNWIND_HAS_NO_RTTI_FLAG -fno-rtti)
append_if(LIBUNWIND_LINK_FLAGS LIBUNWIND_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs)
+# MINGW_LIBRARIES is defined in config-ix.cmake
+append_if(libraries MINGW "${MINGW_LIBRARIES}")
+
if (LIBUNWIND_HAS_NO_EXCEPTIONS_FLAG AND LIBUNWIND_HAS_FUNWIND_TABLES)
list(APPEND LIBUNWIND_COMPILE_FLAGS -fno-exceptions)
list(APPEND LIBUNWIND_COMPILE_FLAGS -funwind-tables)