Skip to content

Commit 3711ce6

Browse files
committed
[lldb] check python extension debug suffix on Win
ae389b2 relies on LLDB_PYTHON_EXT_SUFFIX of Python3_EXECUTABLE for naming the result lldb python lib. Debug python is used in Debug LLDB on Windows, so the result lib name requires "_d". LLDB_PYTHON_EXT_SUFFIX doesn't start with "_d" if Python3_EXECUTABLE wasn't set to Debug executable explicitly. Perhaps a better solution can be found after solving "debug python executable is not currently handled" issue (https://gitlab.kitware.com/cmake/cmake/-/issues/25874#note_1506658).
1 parent 673da8c commit 3711ce6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lldb/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ if (LLDB_ENABLE_PYTHON)
7575
endif()
7676
endif()
7777
endforeach()
78+
# Make sure lldb extension has "_d" suffix on Windows in Debug mode.
79+
if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL Debug)
80+
string(SUBSTRING ${LLDB_PYTHON_EXT_SUFFIX} 0 2 FIRST_2_CHARS)
81+
# Add "_d" manually if LLDB_PYTHON_EXT_SUFFIX lacks it due to release Python configuration.
82+
if(NOT FIRST_2_CHARS STREQUAL "_d")
83+
set(LLDB_PYTHON_EXT_SUFFIX "_d${LLDB_PYTHON_EXT_SUFFIX}")
84+
endif()
85+
endif()
7886
endif ()
7987

8088
if (LLDB_ENABLE_LUA)

0 commit comments

Comments
 (0)