Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 9679ded

Browse files
Mike McLaughlinPetermarcu
authored andcommitted
Fix portable build sos plugin problems. (#12130)
Removing the explicit reference to liblldb. Since the lldb program has already loaded this lib, our will now load regardless of the distro. Issue #12098.
1 parent 3cb371f commit 9679ded

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/ToolBox/SOS/lldbplugin/CMakeLists.txt

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
4545
SET(REQUIRE_LLDBPLUGIN false)
4646
endif()
4747

48-
4948
set(LLVM_HOST_DIR "$ENV{LLVM_HOME}")
5049
set(WITH_LLDB_LIBS "${LLVM_HOST_DIR}/lib" CACHE PATH "Path to LLDB libraries")
5150
set(WITH_LLDB_INCLUDES "${LLVM_HOST_DIR}/include" CACHE PATH "Path to LLDB headers")
@@ -54,20 +53,22 @@ if(NOT ENABLE_LLDBPLUGIN)
5453
return()
5554
endif()
5655

57-
# Check for LLDB library
58-
find_library(LLDB NAMES LLDB lldb lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATHS "${WITH_LLDB_LIBS}" PATH_SUFFIXES llvm NO_DEFAULT_PATH)
59-
find_library(LLDB NAMES LLDB lldb lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATH_SUFFIXES llvm)
60-
if(LLDB STREQUAL LLDB-NOTFOUND)
61-
if(REQUIRE_LLDBPLUGIN)
62-
set(MESSAGE_MODE FATAL_ERROR)
63-
else()
64-
set(MESSAGE_MODE WARNING)
56+
if (CLR_CMAKE_PLATFORM_DARWIN)
57+
# Check for LLDB library
58+
find_library(LLDB NAMES LLDB lldb lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATHS "${WITH_LLDB_LIBS}" PATH_SUFFIXES llvm NO_DEFAULT_PATH)
59+
find_library(LLDB NAMES LLDB lldb lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATH_SUFFIXES llvm)
60+
if(LLDB STREQUAL LLDB-NOTFOUND)
61+
if(REQUIRE_LLDBPLUGIN)
62+
set(MESSAGE_MODE FATAL_ERROR)
63+
else()
64+
set(MESSAGE_MODE WARNING)
65+
endif()
66+
message(${MESSAGE_MODE} "Cannot find lldb-3.5, lldb-3.6, lldb-3.8, lldb-3.9 or lldb-4.0. Try installing lldb-3.6-dev (or the appropriate package for your platform)")
67+
return()
6568
endif()
66-
message(${MESSAGE_MODE} "Cannot find lldb-3.5, lldb-3.6, lldb-3.8, lldb-3.9 or lldb-4.0. Try installing lldb-3.6-dev (or the appropriate package for your platform)")
67-
return()
68-
endif()
6969

70-
message(STATUS "LLDB: ${LLDB}")
70+
message(STATUS "LLDB: ${LLDB}")
71+
endif()
7172

7273
# Check for LLDB headers
7374
# Multiple versions of LLDB can install side-by-side, so we need to check for lldb in various locations.
@@ -120,8 +121,8 @@ endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE ST
120121
_add_library(sosplugin SHARED ${SOURCES})
121122
add_dependencies(sosplugin sos)
122123

123-
if (CLR_CMAKE_PLATFORM_UNIX)
124-
target_link_libraries(sosplugin ${LLDB})
124+
if (CLR_CMAKE_PLATFORM_DARWIN)
125+
target_link_libraries(sosplugin ${LLDB})
125126
endif()
126127

127128
# add the install targets

0 commit comments

Comments
 (0)