llvm-project/lldb/scripts/framework-header-fix.sh
Chelsea Cassanova eb76d8332e
Reland "[lldb][headers] Create script to fix up versioning" (#142864)" (#142871)
This relands the original commit for the versioning script in LLDB. This
commit uses '>' for output from `unifdef` for platforms that have that
executable but do not have the `-o` option. It also fixes the Xcode
build by adding a dependency between the liblldb-header-staging target
in the source/API/CMakeLists.txt the `liblldb-resource-headers` target
in LLDBFramework.cmake.

Original patch: https://github.com/llvm/llvm-project/pull/141116
2025-06-10 09:47:11 -07:00

12 lines
301 B
Bash
Executable File

#!/bin/sh
# Usage: framework-header-fix.sh <source header dir> <LLDB Version>
set -e
for file in `find $1 -name "*.h"`
do
/usr/bin/sed -i.bak 's/\(#include\)[ ]*"lldb\/\(API\/\)\{0,1\}\(.*\)"/\1 <LLDB\/\3>/1' "$file"
/usr/bin/sed -i.bak 's|<LLDB/Utility|<LLDB|' "$file"
rm -f "$file.bak"
done