This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Fix Standalone dialect test to work in out-of-tree builds
ClosedPublic

Authored by krzysz00 on May 27 2021, 12:25 PM.

Details

Summary

When LLVM and MLIR are built as subprojects (via add_subdirectory),
the CMake configuration that indicates where the MLIR libraries are is
not necessarily in the same cmake/ directory as LLVM's configuration.
This patch removes that assumption about where MLIRConfig.cmake is
located.

(As an additional none, the %llvm_lib_dir substitution was never
defined, and so find_package(MLIR) in the build was succeeding for
other reasons.)

Diff Detail

Event Timeline

krzysz00 created this revision.May 27 2021, 12:25 PM
krzysz00 requested review of this revision.May 27 2021, 12:25 PM
krzysz00 added a reviewer: Restricted Project.May 27 2021, 1:58 PM

Not sure if this is the right way to request a review, but there's no indication of a specific person to request from in CODE_OWNERS.txt, so this is it

rriddle edited reviewers, added: stephenneuendorffer, mehdi_amini; removed: Restricted Project.May 27 2021, 1:59 PM

Thanks for looking at this!

mlir/test/CMakeLists.txt
22

Maybe this should be called MLIR_CMAKE_DIR, which is the same variable that is exported by MLIRConfig.cmake? the "CONFIG" in MLIR_CONFIG_CMAKE_DIR I think is intended to imply that it is being implicitly passed to config_file, but that's not happening in this case.

This revision is now accepted and ready to land.May 31 2021, 11:08 PM
krzysz00 updated this revision to Diff 348983.Jun 1 2021, 8:34 AM
krzysz00 edited the summary of this revision. (Show Details)

Rename variables per review comments.

Can someone land this? I don't have write access.