From a16c00a7033df6863f3ecd77a9809790f8db286b Mon Sep 17 00:00:00 2001 From: Stella Laurenzo Date: Thu, 31 Dec 2020 00:11:39 -0800 Subject: [PATCH] [mlir][python] Fix python extension building on windows. --- mlir/cmake/modules/AddMLIRPythonExtension.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mlir/cmake/modules/AddMLIRPythonExtension.cmake b/mlir/cmake/modules/AddMLIRPythonExtension.cmake index eaba521..290b4a2 100644 --- a/mlir/cmake/modules/AddMLIRPythonExtension.cmake +++ b/mlir/cmake/modules/AddMLIRPythonExtension.cmake @@ -44,6 +44,10 @@ function(add_mlir_python_extension libname extname) "${pybind11_INCLUDE_DIR}" ) + target_link_directories(${libname} PRIVATE + "${Python3_LIBRARY_DIRS}" + ) + # The extension itself must be compiled with RTTI and exceptions enabled. # Also, some warning classes triggered by pybind11 are disabled. target_compile_options(${libname} PRIVATE -- 2.7.4