From b88d21127f31c04139281de49dc7be7671bf47d8 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 1 May 2024 12:47:43 -0700 Subject: Install generated API headers into LLDB.framework (#90666) --- lldb/cmake/modules/LLDBConfig.cmake | 1 + lldb/cmake/modules/LLDBFramework.cmake | 2 ++ lldb/include/lldb/API/LLDB.h | 1 + lldb/packages/Python/lldbsuite/test/builders/builder.py | 4 ++++ lldb/packages/Python/lldbsuite/test/make/Makefile.rules | 5 +++-- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index a758261..3c6223b 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -7,6 +7,7 @@ set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include") set(LLDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(LLDB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) +set(LLDB_OBJ_DIR ${CMAKE_CURRENT_BINARY_DIR}) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) message(FATAL_ERROR diff --git a/lldb/cmake/modules/LLDBFramework.cmake b/lldb/cmake/modules/LLDBFramework.cmake index f915839..df2f8dd 100644 --- a/lldb/cmake/modules/LLDBFramework.cmake +++ b/lldb/cmake/modules/LLDBFramework.cmake @@ -71,6 +71,7 @@ endif() # At configuration time, collect headers for the framework bundle and copy them # into a staging directory. Later we can copy over the entire folder. file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h) +set(generated_public_headers ${LLDB_OBJ_DIR}/include/lldb/API/SBLanguages.h) file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h) file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h) list(REMOVE_ITEM root_public_headers ${root_private_headers}) @@ -80,6 +81,7 @@ find_program(unifdef_EXECUTABLE unifdef) set(lldb_header_staging ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders) foreach(header ${public_headers} + ${generated_public_headers} ${root_public_headers}) get_filename_component(basename ${header} NAME) diff --git a/lldb/include/lldb/API/LLDB.h b/lldb/include/lldb/API/LLDB.h index c83eb92..b256544 100644 --- a/lldb/include/lldb/API/LLDB.h +++ b/lldb/include/lldb/API/LLDB.h @@ -40,6 +40,7 @@ #include "lldb/API/SBInstruction.h" #include "lldb/API/SBInstructionList.h" #include "lldb/API/SBLanguageRuntime.h" +#include "lldb/API/SBLanguages.h" #include "lldb/API/SBLaunchInfo.h" #include "lldb/API/SBLineEntry.h" #include "lldb/API/SBListener.h" diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py index 823a982..21ea353 100644 --- a/lldb/packages/Python/lldbsuite/test/builders/builder.py +++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py @@ -148,6 +148,9 @@ class Builder: return libcpp_args return [] + def getLLDBObjRoot(self): + return ["LLDB_OBJ_ROOT={}".format(configuration.lldb_obj_root)] + def _getDebugInfoArgs(self, debug_info): if debug_info is None: return [] @@ -185,6 +188,7 @@ class Builder: self.getSDKRootSpec(), self.getModuleCacheSpec(), self.getLibCxxArgs(), + self.getLLDBObjRoot(), self.getCmdLine(dictionary), ] command = list(itertools.chain(*command_parts)) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index bfd249c..bd8eea3 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -238,10 +238,11 @@ ifeq "$(OS)" "Darwin" endif ifeq "$(OS)" "Darwin" - CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) -I$(LLDB_BASE_DIR)include + CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) else - CFLAGS += $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) -I$(LLDB_BASE_DIR)include + CFLAGS += $(ARCHFLAG)$(ARCH) endif +CFLAGS += -I$(LLDB_BASE_DIR)include -I$(LLDB_OBJ_ROOT)/include CFLAGS += -I$(SRCDIR) -I$(THIS_FILE_DIR) -- cgit v1.1