Skip to content

Revert "[lldb][headers] Create script to fix up versioning" #142864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025
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
6 changes: 6 additions & 0 deletions lldb/scripts/framework-header-fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ 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"
LLDB_VERSION=`echo $2 | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\1/g'`
LLDB_REVISION=`echo $2 | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\3/g'`
LLDB_VERSION_STRING=`echo $2`
/usr/bin/sed -i.bak "s|//#define LLDB_VERSION$|#define LLDB_VERSION $LLDB_VERSION |" "$file"
/usr/bin/sed -i.bak "s|//#define LLDB_REVISION|#define LLDB_REVISION $LLDB_REVISION |" "$file"
/usr/bin/sed -i.bak "s|//#define LLDB_VERSION_STRING|#define LLDB_VERSION_STRING \"$LLDB_VERSION_STRING\" |" "$file"
rm -f "$file.bak"
done
61 changes: 0 additions & 61 deletions lldb/scripts/version-header-fix.py

This file was deleted.

39 changes: 0 additions & 39 deletions lldb/source/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,45 +290,6 @@ else()
endif()
endif()

# Stage all headers in the include directory in the build dir.
file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
set(lldb_header_staging_dir ${CMAKE_BINARY_DIR}/include/lldb)
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)

foreach(header
${public_headers}
${generated_public_headers}
${root_public_headers})
get_filename_component(basename ${header} NAME)
set(staged_header ${lldb_header_staging_dir}/${basename})

if(unifdef_EXECUTABLE)
# unifdef returns 0 when the file is unchanged and 1 if something was changed.
# That means if we successfully remove SWIG code, the build system believes
# that the command has failed and stops. This is undesirable.
set(copy_command ${unifdef_EXECUTABLE} -USWIG -o ${staged_header} ${header} || (exit 0))
else()
set(copy_command ${CMAKE_COMMAND} -E copy ${header} ${staged_header})
endif()

add_custom_command(
DEPENDS ${header} OUTPUT ${staged_header}
COMMAND ${copy_command}
COMMENT "LLDB headers: stage LLDB headers in include directory")

list(APPEND lldb_staged_headers ${staged_header})
endforeach()

add_custom_command(TARGET liblldb POST_BUILD
COMMAND ${LLDB_SOURCE_DIR}/scripts/version-header-fix.py ${LLDB_SOURCE_DIR}/include/lldb/lldb-defines.h ${lldb_header_staging_dir}/lldb-defines.h ${LLDB_VERSION_MAJOR} ${LLDB_VERSION_MINOR} ${LLDB_VERSION_PATCH}
)
add_custom_target(liblldb-header-staging DEPENDS ${lldb_staged_headers})
add_dependencies(liblldb liblldb-header-staging)

if(LLDB_BUILD_FRAMEWORK)
include(LLDBFramework)

Expand Down
7 changes: 0 additions & 7 deletions lldb/test/Shell/Scripts/Inputs/lldb-defines.h

This file was deleted.

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

This file was deleted.

Loading