[flang-commits] [flang] 215eee6 - Revert "[flang][build] Fixed paths discrovery for the out-of-tree build. (#87822)"
Slava Zakharin via flang-commits
flang-commits at lists.llvm.org
Thu Apr 18 09:04:57 PDT 2024
Author: Slava Zakharin
Date: 2024-04-18T09:04:38-07:00
New Revision: 215eee60497489ae0cc7cc78c0d8b8270e057a70
URL: https://github.com/llvm/llvm-project/commit/215eee60497489ae0cc7cc78c0d8b8270e057a70
DIFF: https://github.com/llvm/llvm-project/commit/215eee60497489ae0cc7cc78c0d8b8270e057a70.diff
LOG: Revert "[flang][build] Fixed paths discrovery for the out-of-tree build. (#87822)"
This reverts commit 920298456037b9ed3ab14cb646ef6d3bf95d2c2b.
Added:
Modified:
flang/CMakeLists.txt
Removed:
################################################################################
diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index c8e75024823f2c..71141e5efac488 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -81,13 +81,12 @@ if (FLANG_STANDALONE_BUILD)
mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
endif()
+ # We need a pre-built/installed version of LLVM.
+ find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_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 BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ get_filename_component(LLVM_DIR_ABSOLUTE ${LLVM_DIR} REALPATH)
list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR_ABSOLUTE})
- # We need a pre-built/installed version of LLVM.
- find_package(LLVM REQUIRED HINTS "${LLVM_DIR_ABSOLUTE}")
# Users might specify a path to CLANG_DIR that's:
# * a full path, or
@@ -98,7 +97,7 @@ if (FLANG_STANDALONE_BUILD)
CLANG_DIR_ABSOLUTE
${CLANG_DIR}
REALPATH
- BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ ${CMAKE_CURRENT_SOURCE_DIR})
list(APPEND CMAKE_MODULE_PATH ${CLANG_DIR_ABSOLUTE})
# TODO: Remove when libclangDriver is lifted out of Clang
@@ -125,14 +124,13 @@ if (FLANG_STANDALONE_BUILD)
include(AddClang)
include(TableGen)
+ find_package(MLIR REQUIRED CONFIG)
+ # Use SYSTEM for the same reasons as for LLVM includes
+ include_directories(SYSTEM ${MLIR_INCLUDE_DIRS})
# 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 BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ get_filename_component(MLIR_DIR_ABSOLUTE ${MLIR_DIR} REALPATH)
list(APPEND CMAKE_MODULE_PATH ${MLIR_DIR_ABSOLUTE})
- find_package(MLIR REQUIRED CONFIG HINTS ${MLIR_DIR_ABSOLUTE})
- # Use SYSTEM for the same reasons as for LLVM includes
- include_directories(SYSTEM ${MLIR_INCLUDE_DIRS})
include(AddMLIR)
find_program(MLIR_TABLEGEN_EXE "mlir-tblgen" ${LLVM_TOOLS_BINARY_DIR}
NO_DEFAULT_PATH)
More information about the flang-commits
mailing list