Skip to content

Commit dbaf4cc

Browse files
committed
[lldb] Deploy Python DLL on Windows
1 parent cfc035a commit dbaf4cc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lldb/bindings/python/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,21 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar
183183
DEPENDS ${python_scripts_target})
184184
endif()
185185

186-
# Add a Post-Build Event to copy the custom Python DLL to the lldb binaries dir so that Windows can find it when launching
187-
# lldb.exe or any other executables that were linked with liblldb.
188-
if (WIN32 AND NOT "${PYTHON_DLL}" STREQUAL "")
186+
# Copy the custom Python DLL to the lldb binary dir so that Windows can find it when launching
187+
# lldb.exe or any other executables that were linked with liblldb (both during development and when installing).
188+
if (WIN32 AND NOT "${Python3_RUNTIME_LIBRARY}" STREQUAL "")
189189
# When using the Visual Studio CMake generator the lldb binaries end up in Release/bin, Debug/bin etc.
190190
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin" LLDB_BIN_DIR)
191-
file(TO_NATIVE_PATH "${PYTHON_DLL}" PYTHON_DLL_NATIVE_PATH)
191+
file(TO_NATIVE_PATH "${Python3_RUNTIME_LIBRARY}" PYTHON_DLL_NATIVE_PATH)
192192
add_custom_command(
193193
TARGET ${swig_target}
194194
POST_BUILD
195195
COMMAND ${CMAKE_COMMAND} -E copy ${PYTHON_DLL_NATIVE_PATH} ${LLDB_BIN_DIR} VERBATIM
196196
COMMENT "Copying Python DLL to LLDB binaries directory.")
197+
install(
198+
FILES "${Python3_RUNTIME_LIBRARY}"
199+
TYPE BIN
200+
COMPONENT lldb
201+
)
197202
endif()
198203
endfunction()

0 commit comments

Comments
 (0)