[all-commits] [llvm/llvm-project] 160e6a: [mlir][cmake] Do not export MLIR_MAIN_SRC_DIR and ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Feb 25 08:07:10 PST 2025


  Branch: refs/heads/release/20.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 160e6ace3e1a35b05d1f277aaf34034b1174c5b0
      https://github.com/llvm/llvm-project/commit/160e6ace3e1a35b05d1f277aaf34034b1174c5b0
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2025-02-25 (Tue, 25 Feb 2025)

  Changed paths:
    M flang/CMakeLists.txt
    M flang/include/flang/Optimizer/Dialect/CMakeLists.txt
    M mlir/cmake/modules/MLIRConfig.cmake.in

  Log Message:
  -----------
  [mlir][cmake] Do not export MLIR_MAIN_SRC_DIR and MLIR_INCLUDE_DIR (#125842)

MLIR_MAIN_SRC_DIR and MLIR_INCLUDE_DIR point to the source directory,
which is not installed. As such, the installed MLIRConfig.cmake also
should not reference it.

The comment indicates that these are needed for mlir_tablegen(), but I
don't see any related uses.

The motivation for this is the use in flang, where we end up inheriting
a meaningless MLIR_MAIN_SRC_DIR from a previous MLIR build, whose source
directory doesn't exist anymore, and that cannot be overridden with the
correct path, because it's not a cached variable.

Instead do what all the other projects do for LLVM_MAIN_SRC_DIR and
initialize MLIR_MAIN_SRC_DIR to CMAKE_CURRENT_SOURCE_DIR/../mlir.

For MLIR_INCLUDE_DIR there already is an exported MLIR_INCLUDE_DIRS,
which can be used instead.

(cherry picked from commit 82bd148a3f25439d7f52a32422dc1bcd2da03803)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list