Skip to content

Commit e5cfa0a

Browse files
Revert "[lldb][headers] Create script to fix up versioning" (#142864)
Reverts #141116. It's breaking the Xcode build as well as the build on AIX.
1 parent f327d6d commit e5cfa0a

File tree

5 files changed

+6
-118
lines changed

5 files changed

+6
-118
lines changed

lldb/scripts/framework-header-fix.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@ for file in `find $1 -name "*.h"`
77
do
88
/usr/bin/sed -i.bak 's/\(#include\)[ ]*"lldb\/\(API\/\)\{0,1\}\(.*\)"/\1 <LLDB\/\3>/1' "$file"
99
/usr/bin/sed -i.bak 's|<LLDB/Utility|<LLDB|' "$file"
10+
LLDB_VERSION=`echo $2 | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\1/g'`
11+
LLDB_REVISION=`echo $2 | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\3/g'`
12+
LLDB_VERSION_STRING=`echo $2`
13+
/usr/bin/sed -i.bak "s|//#define LLDB_VERSION$|#define LLDB_VERSION $LLDB_VERSION |" "$file"
14+
/usr/bin/sed -i.bak "s|//#define LLDB_REVISION|#define LLDB_REVISION $LLDB_REVISION |" "$file"
15+
/usr/bin/sed -i.bak "s|//#define LLDB_VERSION_STRING|#define LLDB_VERSION_STRING \"$LLDB_VERSION_STRING\" |" "$file"
1016
rm -f "$file.bak"
1117
done

lldb/scripts/version-header-fix.py

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

lldb/source/API/CMakeLists.txt

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -290,45 +290,6 @@ else()
290290
endif()
291291
endif()
292292

293-
# Stage all headers in the include directory in the build dir.
294-
file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
295-
set(lldb_header_staging_dir ${CMAKE_BINARY_DIR}/include/lldb)
296-
file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
297-
file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h)
298-
list(REMOVE_ITEM root_public_headers ${root_private_headers})
299-
300-
find_program(unifdef_EXECUTABLE unifdef)
301-
302-
foreach(header
303-
${public_headers}
304-
${generated_public_headers}
305-
${root_public_headers})
306-
get_filename_component(basename ${header} NAME)
307-
set(staged_header ${lldb_header_staging_dir}/${basename})
308-
309-
if(unifdef_EXECUTABLE)
310-
# unifdef returns 0 when the file is unchanged and 1 if something was changed.
311-
# That means if we successfully remove SWIG code, the build system believes
312-
# that the command has failed and stops. This is undesirable.
313-
set(copy_command ${unifdef_EXECUTABLE} -USWIG -o ${staged_header} ${header} || (exit 0))
314-
else()
315-
set(copy_command ${CMAKE_COMMAND} -E copy ${header} ${staged_header})
316-
endif()
317-
318-
add_custom_command(
319-
DEPENDS ${header} OUTPUT ${staged_header}
320-
COMMAND ${copy_command}
321-
COMMENT "LLDB headers: stage LLDB headers in include directory")
322-
323-
list(APPEND lldb_staged_headers ${staged_header})
324-
endforeach()
325-
326-
add_custom_command(TARGET liblldb POST_BUILD
327-
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}
328-
)
329-
add_custom_target(liblldb-header-staging DEPENDS ${lldb_staged_headers})
330-
add_dependencies(liblldb liblldb-header-staging)
331-
332293
if(LLDB_BUILD_FRAMEWORK)
333294
include(LLDBFramework)
334295

lldb/test/Shell/Scripts/Inputs/lldb-defines.h

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

lldb/test/Shell/Scripts/TestVersionFixScript.test

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

0 commit comments

Comments
 (0)