[Lldb-commits] [PATCH] D15566: Patch cmake to allow detection of python 2.7.9+

Aidan Dodds via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 16 05:41:48 PST 2015


ADodds created this revision.
ADodds added a reviewer: zturner.
ADodds added a subscriber: lldb-commits.
ADodds set the repository for this revision to rL LLVM.

Some distributions of python have their version defined as follows in patchlevel.h (note the '+'):

#define PY_VERSION      	"2.7.9+"

The '+' char needs to be stripped by the cmake regex so that LLDBs python lib detection is successfull.

Repository:
  rL LLVM

http://reviews.llvm.org/D15566

Files:
  cmake/modules/LLDBConfig.cmake

Index: cmake/modules/LLDBConfig.cmake
===================================================================
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -71,8 +71,8 @@
   if(EXISTS "${PYTHON_INCLUDE_DIRS}/patchlevel.h")
     file(STRINGS "${PYTHON_INCLUDE_DIRS}/patchlevel.h" python_version_str
          REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
-    string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
-                         PYTHONLIBS_VERSION_STRING "${python_version_str}")
+    string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"+]+)[+]?\".*" "\\1"
+         PYTHONLIBS_VERSION_STRING "${python_version_str}")
     message("-- Found Python version ${PYTHONLIBS_VERSION_STRING}")
     string(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.][0-9]+" "python\\1\\2" PYTHONLIBS_BASE_NAME "${PYTHONLIBS_VERSION_STRING}")
     unset(python_version_str)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15566.42994.patch
Type: text/x-patch
Size: 907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151216/4cb0ef32/attachment.bin>


More information about the lldb-commits mailing list