[Lldb-commits] [lldb] [lldb] fix python extension debug suffix on Win (PR #89037)

Alexander M. via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 24 06:48:00 PDT 2024


https://github.com/amordo updated https://github.com/llvm/llvm-project/pull/89037

>From afb03ec26f847a03d0a4439f49c4ae99f2a08f0a Mon Sep 17 00:00:00 2001
From: Alexander Mordovskiy <iammorjj at gmail.com>
Date: Wed, 24 Apr 2024 15:47:40 +0200
Subject: [PATCH] [lldb] check python extension debug suffix on Win

ae389b2450bd604a3f3bbe5b09b333b2d99801dd 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).
---
 lldb/CMakeLists.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 7844d93d78d29a..35100b790b2aca 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -75,6 +75,12 @@ if (LLDB_ENABLE_PYTHON)
       endif()
     endif()
   endforeach()
+  if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL Debug)
+    string(SUBSTRING ${LLDB_PYTHON_EXT_SUFFIX} 0 2 FIRST_2_CHARS)
+    if(NOT FIRST_2_CHARS STREQUAL "_d")
+      set(LLDB_PYTHON_EXT_SUFFIX "_d${LLDB_PYTHON_EXT_SUFFIX}")
+    endif()
+  endif()
 endif ()
 
 if (LLDB_ENABLE_LUA)



More information about the lldb-commits mailing list