Skip to content

Commit 7e471c1

Browse files
authored
[lldb/cmake] Use ADDITIONAL_HEADER(_DIR)?S (#142587)
Replace (questionable) header globs with an explicit argument supported by llvm_add_library.
1 parent 95b5b68 commit 7e471c1

File tree

17 files changed

+39
-17
lines changed

17 files changed

+39
-17
lines changed

lldb/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ endif()
3838
include(LLDBConfig)
3939
include(AddLLDB)
4040

41+
set(LLDB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
42+
4143
# Define the LLDB_CONFIGURATION_xxx matching the build type.
4244
if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
4345
add_definitions(-DLLDB_CONFIGURATION_DEBUG)

lldb/cmake/modules/AddLLDB.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ function(add_lldb_library name)
6868
set_property(GLOBAL APPEND PROPERTY LLDB_PLUGINS ${name})
6969
endif()
7070

71-
if (MSVC_IDE OR XCODE)
72-
string(REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR})
73-
list(GET split_path -1 dir)
74-
file(GLOB_RECURSE headers
75-
../../include/lldb${dir}/*.h)
76-
endif()
7771
if (PARAM_MODULE)
7872
set(libkind MODULE)
7973
elseif (PARAM_SHARED)
@@ -92,7 +86,7 @@ function(add_lldb_library name)
9286
set(pass_NO_INSTALL_RPATH NO_INSTALL_RPATH)
9387
endif()
9488

95-
llvm_add_library(${name} ${libkind} ${headers}
89+
llvm_add_library(${name} ${libkind}
9690
${PARAM_UNPARSED_ARGUMENTS}
9791
LINK_LIBS ${PARAM_LINK_LIBS}
9892
${pass_NO_INSTALL_RPATH}

lldb/source/API/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ add_lldb_library(liblldb SHARED ${option_framework}
125125
${lldb_python_wrapper}
126126
${lldb_lua_wrapper}
127127

128+
ADDITIONAL_HEADER_DIRS
129+
${LLDB_INCLUDE_DIR}/lldb/API
128130
DEPENDS
129131
lldb-sbapi-dwarf-enums
130132

lldb/source/Breakpoint/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ add_lldb_library(lldbBreakpoint NO_PLUGIN_DEPENDENCIES
2626
WatchpointOptions.cpp
2727
WatchpointResource.cpp
2828

29+
ADDITIONAL_HEADER_DIRS
30+
${LLDB_INCLUDE_DIR}/lldb/Breakpoint
2931
LINK_COMPONENTS
3032
Support
3133
LINK_LIBS

lldb/source/Core/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ add_lldb_library(lldbCore NO_PLUGIN_DEPENDENCIES
5757
ThreadedCommunication.cpp
5858
UserSettingsController.cpp
5959
Value.cpp
60+
61+
ADDITIONAL_HEADER_DIRS
62+
${LLDB_INCLUDE_DIR}/lldb/Core
6063
DEPENDS
6164
clang-tablegen-targets
62-
63-
6465
LINK_COMPONENTS
6566
Support
6667
Demangle

lldb/source/DataFormatters/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ add_lldb_library(lldbDataFormatters NO_PLUGIN_DEPENDENCIES
1818
ValueObjectPrinter.cpp
1919
VectorType.cpp
2020

21+
ADDITIONAL_HEADER_DIRS
22+
${LLDB_INCLUDE_DIR}/lldb/DataFormatters
2123
LINK_COMPONENTS
2224
Support
2325
LINK_LIBS

lldb/source/Expression/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ add_lldb_library(lldbExpression NO_PLUGIN_DEPENDENCIES
1717
UserExpression.cpp
1818
UtilityFunction.cpp
1919

20+
ADDITIONAL_HEADER_DIRS
21+
${LLDB_INCLUDE_DIR}/lldb/Expression
2022
DEPENDS
2123
intrinsics_gen
2224

lldb/source/Host/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ endif()
177177
add_lldb_library(lldbHost NO_PLUGIN_DEPENDENCIES
178178
${HOST_SOURCES}
179179

180+
ADDITIONAL_HEADER_DIRS
181+
${LLDB_INCLUDE_DIR}/lldb/Host
180182
LINK_COMPONENTS
181183
Object
182184
Support

lldb/source/Host/macosx/objcxx/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ add_lldb_library(lldbHostMacOSXObjCXX NO_PLUGIN_DEPENDENCIES
88
HostThreadMacOSX.mm
99
MemoryMonitorMacOSX.mm
1010

11+
ADDITIONAL_HEADER_DIRS
12+
${LLDB_INCLUDE_DIR}/lldb/Host/macosx/objcxx
1113
LINK_COMPONENTS
1214
Support
1315
TargetParser

lldb/source/Initialization/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ add_lldb_library(lldbInitialization
1111
SystemInitializer.cpp
1212
SystemLifetimeManager.cpp
1313

14+
ADDITIONAL_HEADER_DIRS
15+
${LLDB_INCLUDE_DIR}/lldb/Initialization
1416
LINK_COMPONENTS
1517
Support
1618
LINK_LIBS

0 commit comments

Comments
 (0)