[Mlir-commits] [mlir] 72dcd90 - Add a custom MLIRBindingsPythonExtension cmake target to group all Python bindings (NFC)

Mehdi Amini llvmlistbot at llvm.org
Thu Nov 5 12:06:40 PST 2020


Author: Mehdi Amini
Date: 2020-11-05T20:06:08Z
New Revision: 72dcd902e7bb9c8d9814d75c69fb00a57570b339

URL: https://github.com/llvm/llvm-project/commit/72dcd902e7bb9c8d9814d75c69fb00a57570b339
DIFF: https://github.com/llvm/llvm-project/commit/72dcd902e7bb9c8d9814d75c69fb00a57570b339.diff

LOG: Add a custom MLIRBindingsPythonExtension cmake target to group all Python bindings (NFC)

This target will depend on each individual extension and represent "all"
Python bindings in the repo. User projects can get a finer grain control by
depending directly on some individual targets as needed.

Added: 
    

Modified: 
    mlir/lib/Bindings/Python/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Bindings/Python/CMakeLists.txt b/mlir/lib/Bindings/Python/CMakeLists.txt
index 447b819c4aca..04762b46a315 100644
--- a/mlir/lib/Bindings/Python/CMakeLists.txt
+++ b/mlir/lib/Bindings/Python/CMakeLists.txt
@@ -3,7 +3,7 @@ if(NOT LLVM_BUILD_LLVM_DYLIB)
 endif()
 
 include(AddMLIRPythonExtension)
-
+add_custom_target(MLIRBindingsPythonExtension)
 ################################################################################
 # Copy python source tree.
 ################################################################################
@@ -18,6 +18,7 @@ set(PY_SRC_FILES
 add_custom_target(MLIRBindingsPythonSources ALL
   DEPENDS ${PY_SRC_FILES}
 )
+add_dependencies(MLIRBindingsPythonExtension MLIRBindingsPythonSources)
 
 foreach(PY_SRC_FILE ${PY_SRC_FILES})
   set(PY_DEST_FILE "${PROJECT_BINARY_DIR}/python/${PY_SRC_FILE}")
@@ -33,7 +34,7 @@ endforeach()
 ################################################################################
 # Build core python extension
 ################################################################################
-add_mlir_python_extension(MLIRBindingsPythonExtension _mlir
+add_mlir_python_extension(MLIRCoreBindingsPythonExtension _mlir
   INSTALL_DIR
     python
   SOURCES
@@ -41,7 +42,7 @@ add_mlir_python_extension(MLIRBindingsPythonExtension _mlir
     IRModules.cpp
     PybindUtils.cpp
 )
-add_dependencies(MLIRBindingsPythonExtension MLIRBindingsPythonSources)
+add_dependencies(MLIRBindingsPythonExtension MLIRCoreBindingsPythonExtension)
 
 # Note that we copy from the source tree just like for headers because
 # it will not be polluted with py_cache runtime artifacts (from testing and


        


More information about the Mlir-commits mailing list