Skip to content

Commit 2c21b76

Browse files
committed
Install generated API headers into LLDB.framework (llvm#90666)
(cherry picked from commit b88d211) Conflicts: lldb/packages/Python/lldbsuite/test/builders/builder.py
1 parent 592a664 commit 2c21b76

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include")
77

88
set(LLDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
99
set(LLDB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
10+
set(LLDB_OBJ_DIR ${CMAKE_CURRENT_BINARY_DIR})
1011

1112
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
1213
message(FATAL_ERROR

lldb/cmake/modules/LLDBFramework.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ endif()
7171
# At configuration time, collect headers for the framework bundle and copy them
7272
# into a staging directory. Later we can copy over the entire folder.
7373
file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
74+
set(generated_public_headers ${LLDB_OBJ_DIR}/include/lldb/API/SBLanguages.h)
7475
file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
7576
file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h)
7677
list(REMOVE_ITEM root_public_headers ${root_private_headers})
@@ -80,6 +81,7 @@ find_program(unifdef_EXECUTABLE unifdef)
8081
set(lldb_header_staging ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders)
8182
foreach(header
8283
${public_headers}
84+
${generated_public_headers}
8385
${root_public_headers})
8486

8587
get_filename_component(basename ${header} NAME)

lldb/include/lldb/API/LLDB.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "lldb/API/SBInstruction.h"
4141
#include "lldb/API/SBInstructionList.h"
4242
#include "lldb/API/SBLanguageRuntime.h"
43+
#include "lldb/API/SBLanguages.h"
4344
#include "lldb/API/SBLaunchInfo.h"
4445
#include "lldb/API/SBLineEntry.h"
4546
#include "lldb/API/SBListener.h"

lldb/packages/Python/lldbsuite/test/builders/builder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ def getLLDBSwiftLibs(self):
175175
return ["SWIFT_LIBS_DIR={}".format(configuration.swift_libs_dir)]
176176
return []
177177

178+
def getLLDBObjRoot(self):
179+
return ["LLDB_OBJ_ROOT={}".format(configuration.lldb_obj_root)]
180+
178181
def _getDebugInfoArgs(self, debug_info):
179182
if debug_info is None:
180183
return []
@@ -216,6 +219,7 @@ def getBuildCommand(
216219
self.getModuleCacheSpec(),
217220
self.getLibCxxArgs(),
218221
self.getLLDBSwiftLibs(),
222+
self.getLLDBObjRoot(),
219223
self.getCmdLine(dictionary),
220224
]
221225
command = list(itertools.chain(*command_parts))

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,11 @@ ifeq "$(OS)" "Darwin"
270270
endif
271271

272272
ifeq "$(OS)" "Darwin"
273-
CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) -I$(LLDB_BASE_DIR)include
273+
CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES)
274274
else
275-
CFLAGS += $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) -I$(LLDB_BASE_DIR)include
275+
CFLAGS += $(ARCHFLAG)$(ARCH)
276276
endif
277+
CFLAGS += -I$(LLDB_BASE_DIR)include -I$(LLDB_OBJ_ROOT)/include
277278

278279
CFLAGS += -I$(SRCDIR) -I$(THIS_FILE_DIR)
279280

0 commit comments

Comments
 (0)