Author: Chelsea Cassanova
Date: 2025-07-03T15:09:15-07:00
New Revision: 45083dc4d2248b2e3f331af745459f2011db4b7f

URL: 
https://github.com/llvm/llvm-project/commit/45083dc4d2248b2e3f331af745459f2011db4b7f
DIFF: 
https://github.com/llvm/llvm-project/commit/45083dc4d2248b2e3f331af745459f2011db4b7f.diff

LOG: [lldb][framework] Correctly place framework files in framework with script 
(#146425)

There's 2 bugs that this commit fixes:
1. Calculate the correct file path for the output file by appending the
basename of the input header instead of appending the entire input
header's path to the framework path.
2. In the script, create the framework's header directory if it does not
exist.

Added: 
    

Modified: 
    lldb/cmake/modules/LLDBFramework.cmake
    lldb/scripts/framework-header-fix.py

Removed: 
    


################################################################################
diff  --git a/lldb/cmake/modules/LLDBFramework.cmake 
b/lldb/cmake/modules/LLDBFramework.cmake
index 70010ffbf738c..bbd717a982cf3 100644
--- a/lldb/cmake/modules/LLDBFramework.cmake
+++ b/lldb/cmake/modules/LLDBFramework.cmake
@@ -112,7 +112,8 @@ 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})
+  get_filename_component(header_basename ${input_header} NAME)
+  set(output_header $<TARGET_FILE_DIR:liblldb>/Headers/${header_basename})
 
   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

diff  --git a/lldb/scripts/framework-header-fix.py 
b/lldb/scripts/framework-header-fix.py
index d8c38511f19af..6ea8df4c24dd4 100755
--- a/lldb/scripts/framework-header-fix.py
+++ b/lldb/scripts/framework-header-fix.py
@@ -113,6 +113,10 @@ def main():
     # arguments in and of themself, so they need to passed in without dashes.
     unifdef_guards = ["-" + guard for guard in args.unifdef_guards]
 
+    # Create the framework's header dir if it doesn't already exist
+    if not os.path.exists(os.path.dirname(output_file_path)):
+        os.makedirs(os.path.dirname(output_file_path))
+
     if framework_version == "lldb_main":
         modify_main_includes(input_file_path, output_file_path)
     if framework_version == "lldb_rpc":


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to