[Mlir-commits] [mlir] aa78c52 - Fix MLIR Python CMake bug causing duplicate sources target.

Stella Laurenzo llvmlistbot at llvm.org
Mon Jul 4 07:08:12 PDT 2022


Author: Stella Laurenzo
Date: 2022-07-04T07:07:53-07:00
New Revision: aa78c5298ea37f2ca8150dc0a1c880be7ec438f4

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

LOG: Fix MLIR Python CMake bug causing duplicate sources target.

The refactor in https://reviews.llvm.org/D128230 introduced a new target and the name is not scoped properly, leading to name collisions on larger projects. It is done properly on the target just below, so applying the same pattern here fixes the issue.

Added: 
    

Modified: 
    mlir/cmake/modules/AddMLIRPython.cmake

Removed: 
    


################################################################################
diff  --git a/mlir/cmake/modules/AddMLIRPython.cmake b/mlir/cmake/modules/AddMLIRPython.cmake
index ed5ada2f77de6..4d05aca5caf86 100644
--- a/mlir/cmake/modules/AddMLIRPython.cmake
+++ b/mlir/cmake/modules/AddMLIRPython.cmake
@@ -211,7 +211,7 @@ function(add_mlir_python_modules name)
 
     if(_source_type STREQUAL "pure")
       # Pure python sources to link into the tree.
-      set(_pure_sources_target "${sources_target}.sources")
+      set(_pure_sources_target "${modules_target}.sources.${sources_target}")
       add_mlir_python_sources_target(${_pure_sources_target}
         INSTALL_COMPONENT ${modules_target}
         INSTALL_DIR ${ARG_INSTALL_PREFIX}


        


More information about the Mlir-commits mailing list