[Mlir-commits] [mlir] cf36ab1 - [MLIR][Python] Use DEST_PREFIX when installing.

Stella Laurenzo llvmlistbot at llvm.org
Thu Jul 29 15:15:36 PDT 2021


Author: Stella Laurenzo
Date: 2021-07-29T22:15:22Z
New Revision: cf36ab1d6c39e80a70b5a1dc80120cccccb5301c

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

LOG: [MLIR][Python] Use DEST_PREFIX when installing.

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

Added: 
    

Modified: 
    mlir/cmake/modules/AddMLIRPython.cmake

Removed: 
    


################################################################################
diff  --git a/mlir/cmake/modules/AddMLIRPython.cmake b/mlir/cmake/modules/AddMLIRPython.cmake
index 435bb7814a17..df3795efe50e 100644
--- a/mlir/cmake/modules/AddMLIRPython.cmake
+++ b/mlir/cmake/modules/AddMLIRPython.cmake
@@ -134,16 +134,16 @@ function(add_mlir_python_modules name)
       get_target_property(_python_root_dir ${sources_target} PYTHON_ROOT_DIR)
       get_target_property(_python_sources ${sources_target} PYTHON_SOURCES)
       get_target_property(_specified_dest_prefix ${sources_target} PYTHON_DEST_PREFIX)
-      set(_dest_prefix "${ARG_ROOT_PREFIX}")
-      if(_specified_dest_prefix)
-        set(_dest_prefix "${_dest_prefix}/${_specified_dest_prefix}")
-      endif()
       foreach(_source_relative_path ${_python_sources})
+        set(_dest_relative_path "${_source_relative_path}")
+        if(_specified_dest_prefix)
+          set(_dest_relative_path "${_specified_dest_prefix}/${_dest_relative_path}")
+        endif()
         set(_src_path "${_python_root_dir}/${_source_relative_path}")
-        set(_dest_path "${_dest_prefix}/${_source_relative_path}")
+        set(_dest_path "${ARG_ROOT_PREFIX}/${_dest_relative_path}")
 
         get_filename_component(_dest_dir "${_dest_path}" DIRECTORY)
-        get_filename_component(_install_path "${ARG_INSTALL_PREFIX}/${_source_relative_path}" DIRECTORY)
+        get_filename_component(_install_path "${ARG_INSTALL_PREFIX}/${_dest_relative_path}" DIRECTORY)
 
         file(MAKE_DIRECTORY "${_dest_dir}")
         add_custom_command(


        


More information about the Mlir-commits mailing list