Skip to content

Commit 06dad35

Browse files
Revert "[lldb][headers] Create Python script to fix up framework headers" (#143941)
Reverts #142051
1 parent 9208b34 commit 06dad35

File tree

7 files changed

+21
-206
lines changed

7 files changed

+21
-206
lines changed

lldb/cmake/modules/LLDBFramework.cmake

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,24 @@ if(NOT APPLE_EMBEDDED)
6868
)
6969
endif()
7070

71+
# At configuration time, collect headers for the framework bundle and copy them
72+
# into a staging directory. Later we can copy over the entire folder.
73+
file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
74+
set(generated_public_headers ${LLDB_OBJ_DIR}/include/lldb/API/SBLanguages.h)
75+
file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
76+
file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h)
77+
list(REMOVE_ITEM root_public_headers ${root_private_headers})
78+
7179
find_program(unifdef_EXECUTABLE unifdef)
7280

73-
# All necessary header files will be staged in the include directory in the build directory,
74-
# so just copy the files from there into the framework's staging directory.
75-
set(lldb_build_dir_header_staging "${CMAKE_BINARY_DIR}/include/lldb")
76-
set(lldb_framework_header_staging "${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders")
77-
file(GLOB lldb_build_dir_header_staging_list ${lldb_build_dir_header_staging}/*)
78-
foreach(header ${lldb_build_dir_header_staging_list})
81+
set(lldb_header_staging ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders)
82+
foreach(header
83+
${public_headers}
84+
${generated_public_headers}
85+
${root_public_headers})
7986

8087
get_filename_component(basename ${header} NAME)
81-
set(staged_header ${lldb_framework_header_staging}/${basename})
88+
set(staged_header ${lldb_header_staging}/${basename})
8289

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

108-
# Take the headers from the staging directory and fix up their includes for the framework.
109-
# Then write them to the output directory.
110-
# Also, run unifdef to remove any specified guards from the header files.
111-
file(GLOB lldb_framework_header_staging_list ${lldb_framework_header_staging}/*)
112-
foreach(header ${lldb_framework_header_staging_list})
113-
114-
set(input_header ${header})
115-
set(output_header $<TARGET_FILE_DIR:liblldb>/Headers/${input_header})
116-
117-
add_custom_command(TARGET liblldb POST_BUILD
118-
COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.py -f lldb_main -i ${input_header} -o ${output_header} -p ${unifdef_EXECUTABLE} USWIG
119-
COMMENT "LLDB.framework: Fix up and copy framework headers"
120-
)
121-
endforeach()
115+
# At build time, copy the staged headers into the framework bundle (and do
116+
# some post-processing in-place).
117+
add_custom_command(TARGET liblldb POST_BUILD
118+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${lldb_header_staging} $<TARGET_FILE_DIR:liblldb>/Headers
119+
COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh $<TARGET_FILE_DIR:liblldb>/Headers ${LLDB_VERSION}
120+
COMMENT "LLDB.framework: copy framework headers"
121+
)
122122

123123
# Copy vendor-specific headers from clang (without staging).
124124
if(NOT APPLE_EMBEDDED)

lldb/scripts/framework-header-fix.py

Lines changed: 0 additions & 126 deletions
This file was deleted.

lldb/test/Shell/Scripts/Inputs/Main/SBAddress.h

Lines changed: 0 additions & 13 deletions
This file was deleted.

lldb/test/Shell/Scripts/Inputs/RPC/RPCSBAddress.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

lldb/test/Shell/Scripts/TestFrameworkFixScript.test

Lines changed: 0 additions & 11 deletions
This file was deleted.

lldb/test/Shell/Scripts/TestFrameworkFixUnifdef.test

Lines changed: 0 additions & 12 deletions
This file was deleted.

lldb/test/Shell/Scripts/TestRPCFrameworkFixScript.test

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)