summaryrefslogtreecommitdiff
path: root/lldb/cmake
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2020-10-07 16:36:32 +0200
committerPavel Labath <pavel@labath.sk>2020-10-08 18:42:50 +0200
commitd4a7c70751cf5c0b0ce344555e3966ddc80290d2 (patch)
tree32a35e344ee458f01c4b78a645aa36aa4a1b5106 /lldb/cmake
parent4424d2428aebd3537d3f5a3625acb65edfb5d11f (diff)
downloadllvm-d4a7c70751cf5c0b0ce344555e3966ddc80290d2.tar.gz
[lldb] Add a cmake warning about the python/swig incompatibility
Raise awareness of the fact that some versions of swig and python (and build types) just don't mix. One day this will be a reason to require swig>=4.0, but this version is too hot off the press right now.. Differential Revision: https://reviews.llvm.org/D88967
Diffstat (limited to 'lldb/cmake')
-rw-r--r--lldb/cmake/modules/FindPythonAndSwig.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/cmake/modules/FindPythonAndSwig.cmake b/lldb/cmake/modules/FindPythonAndSwig.cmake
index c8edaaaca3e0..de274ede5dbf 100644
--- a/lldb/cmake/modules/FindPythonAndSwig.cmake
+++ b/lldb/cmake/modules/FindPythonAndSwig.cmake
@@ -45,6 +45,17 @@ else()
message(STATUS "SWIG 2 or later is required for Python support in LLDB but could not be found")
endif()
+ get_property(MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ if ("${Python3_VERSION}" VERSION_GREATER_EQUAL "3.7" AND
+ "${SWIG_VERSION}" VERSION_LESS "4.0" AND WIN32 AND (
+ ${MULTI_CONFIG} OR (${uppercase_CMAKE_BUILD_TYPE} STREQUAL "DEBUG")))
+ # Technically this can happen with non-Windows builds too, but we are not
+ # able to detect whether Python was built with assertions, and only Windows
+ # has the requirement that Debug LLDB must use Debug Python.
+ message(WARNING "Debug builds of LLDB are likely to be unusable due to "
+ "<https://github.com/swig/swig/issues/1321>. Please use SWIG >= 4.0.")
+ endif()
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PythonAndSwig
FOUND_VAR