Skip to content

Commit 225ba87

Browse files
committed
[lldb] Warn when static bindings are out of sync
Print a warning when the static bindings are out of sync. The warning only triggers when not using the static bindings (because otherwise they'll be identical by design). The warning also includes the command to update them in the project source.
1 parent d7e2e28 commit 225ba87

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)