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

Commit c1b65bd

Browse files
author
Mikhail I. Krivtsov
committed
Fix LLDB search order
By default 'find_library' without 'NO_DEFAULT_PATH' keyword searches first in default locations specified by '${CMAKE_SYSTEM_PREFIX_PATH}' and only then in locations specified via 'PATHS' keyword ('${WITH_LLDB_LIBS}' in our case). As result it always picks-up default LLDB ignoring the one explicitly specified via '${WITH_LLDB_LIBS}'. This change modifies search order giving priority to '${WITH_LLDB_LIBS}' and '${WITH_LLDB_INCLUDES}' over default locations.
1 parent 9990ac9 commit c1b65bd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ToolBox/SOS/lldbplugin/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ if(NOT ENABLE_LLDBPLUGIN)
4141
endif()
4242

4343
# Check for LLDB library
44-
find_library(LLDB NAMES LLDB lldb lldb-3.8 lldb-3.6 lldb-3.5 PATHS "${WITH_LLDB_LIBS}" PATH_SUFFIXES llvm)
44+
find_library(LLDB NAMES LLDB lldb lldb-3.8 lldb-3.6 lldb-3.5 PATHS "${WITH_LLDB_LIBS}" PATH_SUFFIXES llvm NO_DEFAULT_PATH)
45+
find_library(LLDB NAMES LLDB lldb lldb-3.8 lldb-3.6 lldb-3.5 PATH_SUFFIXES llvm)
4546
if(LLDB STREQUAL LLDB-NOTFOUND)
4647
if(REQUIRE_LLDBPLUGIN)
4748
message(FATAL_ERROR "Cannot find lldb-3.5, lldb-3.6 or lldb-3.8. Try installing lldb-3.6-dev (or the appropriate package for your platform)")
@@ -55,7 +56,8 @@ message(STATUS "LLDB: ${LLDB}")
5556

5657
# Check for LLDB headers
5758

58-
find_path(LLDB_H "lldb/API/LLDB.h" PATHS "${WITH_LLDB_INCLUDES}")
59+
find_path(LLDB_H "lldb/API/LLDB.h" PATHS "${WITH_LLDB_INCLUDES}" NO_DEFAULT_PATH)
60+
find_path(LLDB_H "lldb/API/LLDB.h")
5961
if(LLDB_H STREQUAL LLDB_H-NOTFOUND)
6062
find_path(LLDB_H "lldb/API/LLDB.h" PATHS "/usr/lib/llvm-3.8/include")
6163
if(LLDB_H STREQUAL LLDB_H-NOTFOUND)

0 commit comments

Comments
 (0)