summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libunwind/CMakeLists.txt7
-rw-r--r--libunwind/src/AddressSpace.hpp2
-rw-r--r--libunwind/src/RWMutex.hpp2
3 files changed, 8 insertions, 3 deletions
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 25dc95cf6ba..08095d1333a 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -352,7 +352,12 @@ if (WIN32 AND LIBUNWIND_ENABLE_STATIC AND NOT LIBUNWIND_ENABLE_SHARED)
endif()
if (LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
- add_definitions(-D_LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
+ if (LIBUNWIND_HAS_DL_LIB)
+ add_definitions(-D_LIBUNWIND_LINK_DL_LIB)
+ endif()
+ if (LIBUNWIND_HAS_PTHREAD_LIB)
+ add_definitions(-D_LIBUNWIND_LINK_PTHREAD_LIB)
+ endif()
endif()
#===============================================================================
diff --git a/libunwind/src/AddressSpace.hpp b/libunwind/src/AddressSpace.hpp
index db67df4dc80..7433476f911 100644
--- a/libunwind/src/AddressSpace.hpp
+++ b/libunwind/src/AddressSpace.hpp
@@ -27,7 +27,7 @@
#if _LIBUNWIND_USE_DLADDR
#include <dlfcn.h>
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBUNWIND_LINK_DL_LIB)
#pragma comment(lib, "dl")
#endif
#endif
diff --git a/libunwind/src/RWMutex.hpp b/libunwind/src/RWMutex.hpp
index 954e94c322d..fcd3f4967d1 100644
--- a/libunwind/src/RWMutex.hpp
+++ b/libunwind/src/RWMutex.hpp
@@ -17,7 +17,7 @@
#include <windows.h>
#elif !defined(_LIBUNWIND_HAS_NO_THREADS)
#include <pthread.h>
-#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBUNWIND_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
#endif
OpenPOWER on IntegriCloud