[Mlir-commits] [mlir] 9bda935 - [mlir][Python] Adapt to include property change in pybind11 v2.6.

Stella Laurenzo llvmlistbot at llvm.org
Sat Nov 7 09:07:20 PST 2020


Author: Stella Laurenzo
Date: 2020-11-07T09:06:13-08:00
New Revision: 9bda935289fdd3948ccb413dc5857b4a8c69b972

URL: https://github.com/llvm/llvm-project/commit/9bda935289fdd3948ccb413dc5857b4a8c69b972
DIFF: https://github.com/llvm/llvm-project/commit/9bda935289fdd3948ccb413dc5857b4a8c69b972.diff

LOG: [mlir][Python] Adapt to include property change in pybind11 v2.6.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D90955

Added: 
    

Modified: 
    mlir/CMakeLists.txt
    mlir/cmake/modules/AddMLIRPythonExtension.cmake

Removed: 
    


################################################################################
diff  --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 0954eeae0763..2842a1e82a91 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -81,9 +81,13 @@ if(MLIR_BINDINGS_PYTHON_ENABLED)
   find_package(PythonInterp REQUIRED)
   find_package(PythonLibs REQUIRED)
   message(STATUS "Found python include dirs: ${PYTHON_INCLUDE_DIRS}")
-  message(STATUS "Found ppython libraries: ${PYTHON_LIBRARIES}")
+  message(STATUS "Found python libraries: ${PYTHON_LIBRARIES}")
   find_package(pybind11 CONFIG REQUIRED)
-  message(STATUS "Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIRS}")
+  # TODO: pybind11 v2.6 switched from pybind11_INCLUDE_DIRS (plural) to
+  # pybind11_INCLUDE_DIR (singular). A lot has changed in this area since this
+  # was written and overall python config and pybind11 should be modernized.
+  set(pybind11_INCLUDE_DIR ${pybind11_INCLUDE_DIR} ${pybind11_INCLUDE_DIRS})
+  message(STATUS "Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIR}")
   message(STATUS "Python prefix = '${PYTHON_MODULE_PREFIX}', "
                  "suffix = '${PYTHON_MODULE_SUFFIX}', "
                  "extension = '${PYTHON_MODULE_EXTENSION}")

diff  --git a/mlir/cmake/modules/AddMLIRPythonExtension.cmake b/mlir/cmake/modules/AddMLIRPythonExtension.cmake
index 5d9bb9753133..f9b749a27649 100644
--- a/mlir/cmake/modules/AddMLIRPythonExtension.cmake
+++ b/mlir/cmake/modules/AddMLIRPythonExtension.cmake
@@ -44,7 +44,7 @@ function(add_mlir_python_extension libname extname)
 
   target_include_directories(${libname} PRIVATE
     "${PYTHON_INCLUDE_DIRS}"
-    "${pybind11_INCLUDE_DIRS}"
+    "${pybind11_INCLUDE_DIR}"
   )
 
   # The extension itself must be compiled with RTTI and exceptions enabled.


        


More information about the Mlir-commits mailing list