[PATCH] D87083: [cmake] Use absolute paths for modules search
Diana Picus via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 9 05:00:01 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd4b88ac1658d: [cmake] Use absolute paths for modules search (authored by rovka).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87083/new/
https://reviews.llvm.org/D87083
Files:
flang/CMakeLists.txt
Index: flang/CMakeLists.txt
===================================================================
--- flang/CMakeLists.txt
+++ flang/CMakeLists.txt
@@ -56,7 +56,10 @@
# We need a pre-built/installed version of LLVM.
find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
- list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
+ # If the user specifies a relative path to LLVM_DIR, the calls to include
+ # LLVM modules fail. Append the absolute path to LLVM_DIR instead.
+ get_filename_component(LLVM_DIR_ABSOLUTE ${LLVM_DIR} REALPATH)
+ list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR_ABSOLUTE})
# If LLVM links to zlib we need the imported targets so we can too.
if(LLVM_ENABLE_ZLIB)
@@ -78,7 +81,10 @@
find_package(MLIR REQUIRED CONFIG)
# Use SYSTEM for the same reasons as for LLVM includes
include_directories(SYSTEM ${MLIR_INCLUDE_DIRS})
- list(APPEND CMAKE_MODULE_PATH ${MLIR_DIR})
+ # If the user specifies a relative path to MLIR_DIR, the calls to include
+ # MLIR modules fail. Append the absolute path to MLIR_DIR instead.
+ get_filename_component(MLIR_DIR_ABSOLUTE ${MLIR_DIR} REALPATH)
+ list(APPEND CMAKE_MODULE_PATH ${MLIR_DIR_ABSOLUTE})
include(AddMLIR)
find_program(MLIR_TABLEGEN_EXE "mlir-tblgen" ${LLVM_TOOLS_BINARY_DIR}
NO_DEFAULT_PATH)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87083.290716.patch
Type: text/x-patch
Size: 1306 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200909/2afb4f61/attachment.bin>
More information about the llvm-commits
mailing list