Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions lldb/cmake/modules/LLDBFramework.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,24 @@ if(NOT APPLE_EMBEDDED)
)
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})

find_program(unifdef_EXECUTABLE unifdef)

# All necessary header files will be staged in the include directory in the build directory,
# so just copy the files from there into the framework's staging directory.
set(lldb_build_dir_header_staging "${CMAKE_BINARY_DIR}/include/lldb")
set(lldb_framework_header_staging "${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders")
file(GLOB lldb_build_dir_header_staging_list ${lldb_build_dir_header_staging}/*)
foreach(header ${lldb_build_dir_header_staging_list})
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)
set(staged_header ${lldb_framework_header_staging}/${basename})
set(staged_header ${lldb_header_staging}/${basename})

if(unifdef_EXECUTABLE)
# unifdef returns 0 when the file is unchanged and 1 if something was changed.
Expand All @@ -105,20 +112,13 @@ set_target_properties(liblldb-resource-headers PROPERTIES FOLDER "LLDB/Resources
add_dependencies(liblldb-resource-headers liblldb-header-staging)
add_dependencies(liblldb liblldb-resource-headers)

# Take the headers from the staging directory and fix up their includes for the framework.
# Then write them to the output directory.
# Also, run unifdef to remove any specified guards from the header files.
file(GLOB lldb_framework_header_staging_list ${lldb_framework_header_staging}/*)
foreach(header ${lldb_framework_header_staging_list})

set(input_header ${header})
set(output_header $<TARGET_FILE_DIR:liblldb>/Headers/${input_header})

add_custom_command(TARGET liblldb POST_BUILD
COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.py -f lldb_main -i ${input_header} -o ${output_header} -p ${unifdef_EXECUTABLE} USWIG
COMMENT "LLDB.framework: Fix up and copy framework headers"
)
endforeach()
# At build time, copy the staged headers into the framework bundle (and do
# some post-processing in-place).
add_custom_command(TARGET liblldb POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${lldb_header_staging} $<TARGET_FILE_DIR:liblldb>/Headers
COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh $<TARGET_FILE_DIR:liblldb>/Headers ${LLDB_VERSION}
COMMENT "LLDB.framework: copy framework headers"
)

# Copy vendor-specific headers from clang (without staging).
if(NOT APPLE_EMBEDDED)
Expand Down
126 changes: 0 additions & 126 deletions lldb/scripts/framework-header-fix.py

This file was deleted.

13 changes: 0 additions & 13 deletions lldb/test/Shell/Scripts/Inputs/Main/SBAddress.h

This file was deleted.

9 changes: 0 additions & 9 deletions lldb/test/Shell/Scripts/Inputs/RPC/RPCSBAddress.h

This file was deleted.

11 changes: 0 additions & 11 deletions lldb/test/Shell/Scripts/TestFrameworkFixScript.test

This file was deleted.

12 changes: 0 additions & 12 deletions lldb/test/Shell/Scripts/TestFrameworkFixUnifdef.test

This file was deleted.

14 changes: 0 additions & 14 deletions lldb/test/Shell/Scripts/TestRPCFrameworkFixScript.test

This file was deleted.

Loading