From eb5ee9275d7a5efa54b89ca7fcf2adfaa326a457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sat, 1 Feb 2020 22:45:28 +0200 Subject: [PATCH] [LLDB] Add missing declarations for linking to psapi This fixes building for mingw with BUILD_SHARED_LIBS. In static builds, the psapi dependency gets linked in transitively from Support, but when linking Support dynamically, it's revealed that these components also need linking against psapi. Differential Revision: https://reviews.llvm.org/D73839 --- lldb/source/Host/CMakeLists.txt | 3 +++ lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt index 2e9bb4022270..a15c34fdbb6b 100644 --- a/lldb/source/Host/CMakeLists.txt +++ b/lldb/source/Host/CMakeLists.txt @@ -161,6 +161,9 @@ endif() if (LLDB_ENABLE_LZMA) list(APPEND EXTRA_LIBS ${LIBLZMA_LIBRARIES}) endif() +if (WIN32) + list(APPEND LLDB_SYSTEM_LIBS psapi) +endif () if (LLDB_ENABLE_LIBEDIT) list(APPEND LLDB_LIBEDIT_LIBS ${LibEdit_LIBRARIES}) diff --git a/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt b/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt index 876bc8cab966..e77c204fd61e 100644 --- a/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt +++ b/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt @@ -29,6 +29,7 @@ add_lldb_library(lldbPluginProcessWindowsCommon PLUGIN lldbTarget ws2_32 rpcrt4 + psapi LINK_COMPONENTS Support )