Skip to content

Commit 100124b

Browse files
authored
Merge pull request #5640 from apple/jdevlieghere/diff-static-bindings
[lldb] Warn when static bindings are out of sync
2 parents 1fa1aab + 225ba87 commit 100124b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lldb/bindings/python/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,14 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar
190190
COMMENT "Copying Python DLL to LLDB binaries directory.")
191191
endif()
192192
endfunction()
193+
194+
if(${LLDB_USE_STATIC_BINDINGS})
195+
set(SOURCE_STATIC_BINDING ${CMAKE_CURRENT_SOURCE_DIR}/static-binding/lldb.py)
196+
set(BINARY_STATIC_BINDING ${CMAKE_CURRENT_BINARY_DIR}/lldb.py)
197+
set(COPY_STATIC_BINDING ${LLDB_SOURCE_DIR}/scripts/copy-static-bindings.py)
198+
199+
add_custom_command(TARGET swig_wrapper_python POST_BUILD VERBATIM
200+
COMMAND diff -q ${SOURCE_STATIC_BINDING} ${BINARY_STATIC_BINDING} || ${CMAKE_COMMAND} -E cmake_echo_color --red "Update the static bindings by running the following command: ${COPY_STATIC_BINDING} ${CMAKE_BINARY_DIR}"
201+
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lldb.py
202+
COMMENT "Diff the static bindings")
203+
endif()

0 commit comments

Comments
 (0)