[Lldb-commits] [PATCH] D74917: [lldb/bindings] Fail configuration when a required dependency is not met.

Matt Davis via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 20 11:15:49 PST 2020


mattd created this revision.
mattd added reviewers: aadsm, hhb.
mattd added a project: LLDB.
Herald added a subscriber: mgorny.

If the SWIG dependency is required {LLDB_ENABLE_PYTHON, LLDB_ENABLE_LUA}
and SWIG is not available, fail the configuration step.  Terminate the
configure early rather than later with a clear error message.

We could possibly modify:
`llvm-project/lldb/cmake/modules/FindPythonInterpAndLibs.cmake`
However, the patch here seems clear in my opinion.


https://reviews.llvm.org/D74917

Files:
  lldb/bindings/CMakeLists.txt


Index: lldb/bindings/CMakeLists.txt
===================================================================
--- lldb/bindings/CMakeLists.txt
+++ lldb/bindings/CMakeLists.txt
@@ -33,6 +33,10 @@
 )
 
 if (LLDB_ENABLE_PYTHON)
+  if (NOT SWIG_FOUND)
+    message(FATAL_ERROR
+            "The SWIG package is required for Python support in LLDB.")
+  endif()
   add_custom_command(
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lldb.py
@@ -57,6 +61,10 @@
 endif()
 
 if (LLDB_ENABLE_LUA)
+  if (NOT SWIG_FOUND)
+    message(FATAL_ERROR
+            "The SWIG package is required for LUA support in LLDB.")
+  endif()
   add_custom_command(
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapLua.cpp
     DEPENDS ${SWIG_SOURCES}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74917.245696.patch
Type: text/x-patch
Size: 770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200220/b1f43a6a/attachment.bin>


More information about the lldb-commits mailing list