-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flang][build] Fixed paths discrovery for the out-of-tree build. #87822
Conversation
When building flang out-of-tree with relative paths in LLVM_DIR, CLANG_DIR and MLIR_DIR, we need to compute the absolute paths based on the CMake build directory (i.e. where the cmake is invoked from).
@@ -81,12 +81,13 @@ 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}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This use of LLVM_CMAKE_DIR
does not make much sense to me, because it is set by LLVMConfig.cmake
which is not in effect before this find_package
command executes.
@@ -97,7 +98,7 @@ if (FLANG_STANDALONE_BUILD) | |||
CLANG_DIR_ABSOLUTE | |||
${CLANG_DIR} | |||
REALPATH | |||
${CMAKE_CURRENT_SOURCE_DIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like BASE_DIR
was meant to be used here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All builds and tests correctly and looks good.
This commit is breaking this buildbot: https://lab.llvm.org/buildbot/#/builders/175 Could you please take a look? |
I do not know how I missed that breakage. Thank you for letting me know, @ceseo! I will look immediately. |
I see what happened. This change actually fixed handling of the relative paths, but this buildbot was using a trick to workaround the issue that was fixed. The buildbot builds LLVM tree here:
And it is run from The buildbot needs to be fixed, since we can now use "real" paths relative to the Flang build directory. |
After llvm/llvm-project#87822 we can specify real relative paths from the flang build directory to the directories containing LLVM/CLANG/etc. projects' config files.
After llvm/llvm-project#87822 we can specify real relative paths from the flang build directory to the directories containing LLVM/CLANG/etc. projects' config files.
…ld. (llvm#87822)" This reverts commit 215eee6.
When building flang out-of-tree with relative paths in LLVM_DIR,
CLANG_DIR and MLIR_DIR, we need to compute the absolute paths
based on the CMake build directory (i.e. where the cmake is invoked
from).