@@ -70,15 +70,21 @@ endif()
70
70
71
71
find_program (unifdef_EXECUTABLE unifdef )
72
72
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} )
73
+ # Glob all necessary header files from source and place them into a list.
74
+ # These headers will then be collected for the framework and placed in the
75
+ # FrameworkHeaders staging directory.
76
+ file (GLOB public_headers ${LLDB_SOURCE_DIR} /include/lldb/API/*.h )
77
+ set (generated_public_headers ${LLDB_OBJ_DIR} /include/lldb/API/SBLanguages.h )
78
+ file (GLOB root_public_headers ${LLDB_SOURCE_DIR} /include/lldb/lldb-*.h )
79
+ file (GLOB root_private_headers ${LLDB_SOURCE_DIR} /include/lldb/lldb-private*.h )
80
+ list (REMOVE_ITEM root_public_headers ${root_private_headers} )
81
+ set (lldb_framework_header_staging_list ${public_headers} ${generated_public_headers} ${root_public_headers} )
82
+
83
+ set (lldb_framework_header_staging_dir ${CMAKE_CURRENT_BINARY_DIR} /FrameworkHeaders )
84
+ foreach (header ${lldb_framework_header_staging_list} )
79
85
80
86
get_filename_component (basename ${header} NAME )
81
- set (staged_header ${lldb_framework_header_staging } /${basename} )
87
+ set (staged_header ${lldb_framework_header_staging_dir } /${basename} )
82
88
83
89
if (unifdef_EXECUTABLE )
84
90
# unifdef returns 0 when the file is unchanged and 1 if something was changed.
@@ -106,17 +112,17 @@ add_dependencies(liblldb-resource-headers liblldb-header-staging)
106
112
add_dependencies (liblldb liblldb-resource-headers )
107
113
108
114
# Take the headers from the staging directory and fix up their includes for the framework.
109
- # Then write them to the output directory .
115
+ # Then write them to the framework itself .
110
116
# Also, run unifdef to remove any specified guards from the header files.
111
- file (GLOB lldb_framework_header_staging_list ${lldb_framework_header_staging} /* )
117
+ file (GLOB lldb_framework_staged_headers ${CMAKE_CURRENT_BINARY_DIR} /FrameworkHeaders/*.h )
112
118
foreach (header ${lldb_framework_header_staging_list} )
113
119
114
120
set (input_header ${header} )
115
121
get_filename_component (header_basename ${input_header} NAME )
116
122
set (output_header $< TARGET_FILE_DIR:liblldb> /Headers/${header_basename} )
117
123
118
124
add_custom_command (TARGET liblldb POST_BUILD
119
- COMMAND ${LLDB_SOURCE_DIR} /scripts/framework-header-fix.py -f lldb_main -i ${input_header} -o ${output_header} -p ${unifdef_EXECUTABLE} USWIG
125
+ COMMAND " ${Python3_EXECUTABLE} " ${LLDB_SOURCE_DIR} /scripts/framework-header-fix.py -f lldb_main -i ${input_header} -o ${output_header} -p ${unifdef_EXECUTABLE} USWIG
120
126
COMMENT "LLDB.framework: Fix up and copy framework headers"
121
127
)
122
128
endforeach ()
0 commit comments