You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lldb/cmake/modules/LLDBConfig.cmake
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -180,15 +180,29 @@ if (LLDB_ENABLE_PYTHON)
180
180
"Path to use as PYTHONHOME in lldb. If a relative path is specified, it will be resolved at runtime relative to liblldb directory.")
181
181
endif()
182
182
183
-
if (SWIG_VERSION VERSION_GREATER_EQUAL"4.2"
184
-
AND Python3_VERSION VERSION_GREATER_EQUAL"3.11"
183
+
set(python_limited_api_swig_version "4.2")
184
+
set(python_limited_api_python_version "3.11")
185
+
186
+
if (SWIG_VERSION VERSION_GREATER_EQUAL python_limited_api_swig_version
187
+
AND Python3_VERSION VERSION_GREATER_EQUAL python_limited_api_python_version
185
188
ANDNOT LLDB_EMBED_PYTHON_HOME)
186
189
set(default_enable_python_limited_api ON)
187
190
else()
188
191
set(default_enable_python_limited_api OFF)
189
192
endif()
190
193
option(LLDB_ENABLE_PYTHON_LIMITED_API "Only use the Python Limited API (requires at least Python 3.11 and SWIG 4.2)"
191
194
${default_enable_python_limited_api})
195
+
196
+
# Diagnose unsupported configurations.
197
+
if (LLDB_ENABLE_PYTHON_LIMITED_API AND LLDB_EMBED_PYTHON_HOME)
198
+
message(SEND_ERROR "LLDB_ENABLE_PYTHON_LIMITED_API is not compatible with LLDB_EMBED_PYTHON_HOME")
199
+
endif()
200
+
if (LLDB_ENABLE_PYTHON_LIMITED_API AND Python3_VERSION VERSION_LESS python_limited_api_python_version)
201
+
message(SEND_ERROR "LLDB_ENABLE_PYTHON_LIMITED_API is not compatible with Python ${Python3_VERSION} (requires Python ${python_limited_api_python_version})")
202
+
endif()
203
+
if (LLDB_ENABLE_PYTHON_LIMITED_API AND SWIG_VERSION VERSION_LESS python_limited_api_swig_version)
204
+
message(SEND_ERROR "LLDB_ENABLE_PYTHON_LIMITED_API is not compatible with SWIG ${SWIG_VERSION} (requires SWIG ${python_limited_api_swig_version})")
205
+
endif()
192
206
else()
193
207
# Even if Python scripting is disabled, we still need a Python interpreter to
0 commit comments