aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API
diff options
context:
space:
mode:
authorChelsea Cassanova <chelsea_cassanova@apple.com>2025-07-18 15:26:09 -0500
committerGitHub <noreply@github.com>2025-07-18 15:26:09 -0500
commitd64802d6d96ec5aff3739ce34f8143b935921809 (patch)
tree6458e3bf87e6fb0e959a291c0205c07d66f238b1 /lldb/source/API
parentb846d8c3e26ef98c8d6936e7cad354f035d322d1 (diff)
downloadllvm-d64802d6d96ec5aff3739ce34f8143b935921809.zip
llvm-d64802d6d96ec5aff3739ce34f8143b935921809.tar.gz
llvm-d64802d6d96ec5aff3739ce34f8143b935921809.tar.bz2
[lldb][framework] Glob headers from source for framework (#148736)
When gathering the headers to fix up and place in LLDB.framework, we were previously globbing the header files from a location in the build directory. This commit changes this to glob from the source directory instead, as we were globbing from the build directory without ensuring that the necessary files were actually in that location before globbing.
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/CMakeLists.txt24
1 files changed, 22 insertions, 2 deletions
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 4751ed3..197c98c 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -295,12 +295,21 @@ endif()
# Stage all headers in the include directory in the build dir.
file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
set(lldb_header_staging_dir ${CMAKE_BINARY_DIR}/include/lldb)
+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})
find_program(unifdef_EXECUTABLE unifdef)
+add_custom_target(liblldb-header-staging DEPENDS ${lldb_staged_headers} ${lldb_header_staging_dir}/lldb-defines.h)
+
+if (LLDB_BUILD_FRAMEWORK)
+ add_custom_target(lldb-framework-fixup-all-headers)
+ add_dependencies(lldb-framework-fixup-all-headers liblldb-header-staging)
+ add_dependencies(liblldb lldb-framework-fixup-all-headers)
+endif()
+
foreach(header
${public_headers}
${generated_public_headers}
@@ -323,12 +332,23 @@ foreach(header
COMMENT "LLDB headers: stage LLDB headers in include directory")
list(APPEND lldb_staged_headers ${staged_header})
+
+ if (LLDB_BUILD_FRAMEWORK)
+ set(output_header $<TARGET_FILE_DIR:liblldb>/Headers/${basename})
+
+ add_custom_target(lldb-framework-fixup-header-${basename} DEPENDS ${staged_header})
+ add_dependencies(lldb-framework-fixup-all-headers lldb-framework-fixup-header-${basename})
+
+ add_custom_command(TARGET lldb-framework-fixup-header-${basename} POST_BUILD
+ COMMAND "${Python3_EXECUTABLE}" ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.py -f lldb_main -i ${staged_header} -o ${output_header}
+ COMMENT "LLDB.framework: Fix up and copy framework headers"
+ )
+ endif()
endforeach()
-add_custom_command(TARGET liblldb POST_BUILD
+add_custom_command(TARGET liblldb-header-staging POST_BUILD
COMMAND "${Python3_EXECUTABLE}" ${LLDB_SOURCE_DIR}/scripts/version-header-fix.py -i ${LLDB_SOURCE_DIR}/include/lldb/lldb-defines.h -o ${lldb_header_staging_dir}/lldb-defines.h -m ${LLDB_VERSION_MAJOR} -n ${LLDB_VERSION_MINOR} -p ${LLDB_VERSION_PATCH}
)
-add_custom_target(liblldb-header-staging DEPENDS ${lldb_staged_headers})
add_dependencies(liblldb liblldb-header-staging)
if(LLDB_BUILD_FRAMEWORK)