-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[CMake] Get Clang directory from CLANG_INSTALL_PREFIX #18460
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
Conversation
|
I disagree with merging any build system related work at this point. |
|
Sure, this can also be done after the branching of 6.36! |
Test Results 18 files 18 suites 3d 17h 17m 17s ⏱️ Results for commit fbec790. ♻️ This comment has been updated with latest results. |
|
@hahnjo, what do you think about this for |
79840fe to
5807d94
Compare
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.
Hm wait, CLANG_INSTALL_PREFIX is not set for me with builtin_clang=OFF... Could be that we have to forward it
hahnjo
left a comment
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.
I think we need
diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt
index e6512a88828..014be83dc28 100644
--- a/interpreter/CMakeLists.txt
+++ b/interpreter/CMakeLists.txt
@@ -407,6 +407,9 @@ if (builtin_clang)
else()
find_package(Clang REQUIRED CONFIG)
message(STATUS "Found Clang ${CLANG_PACKAGE_VERSION} in ${CLANG_CMAKE_DIR}")
+
+ # Forward CLANG_INSTALL_PREFIX so it can be used by core/clingutils/CMakeLists.txt
+ set(CLANG_INSTALL_PREFIX ${CLANG_INSTALL_PREFIX} PARENT_SCOPE)
endif()
# Reset the compiler flags after compiling LLVM and ClangIt might have worked by accident before if /lib/clang/ happened to contain files for the right Clang version...
But the change is in the I have tested it for my setup: system LLVM without Clang and then standalone Clang in different directory, and it works |
Yes sorry, my comment was supposed to say
Can you print the result of |
|
Ok, I'll check. But I will also make some test with a full LLVM build including patched Clang so I'm more sure to understand all cases. So for me the PR is on hold anyway |
5807d94 to
1f71e8b
Compare
|
Hi @hahnjo! I now tested this PR with two configurations:
Both works! By the way, what do you think about doing |
1f71e8b to
6b4a4f1
Compare
If Clang was installed standalone (in particular, not in the LLVM tree), use the CLANG_INSTALL_PREFIX variable to indicate where it is. Actually, we can always use `CLANG_INSTALL_PREFIX`. It's defined by `ClangConfig.cmake`. To make sure that this works, `find_package(Clang)` has to be called in `core/clingutils/CMakeLists.txt`.
6b4a4f1 to
fbec790
Compare
Potentially, but we also compute many other variables in |
If Clang was installed standalone (in particular, not in the LLVM tree),
use the CLANG_INSTALL_PREFIX variable to indicate where it is.
Actually, we can always use
CLANG_INSTALL_PREFIX. It's defined byClangConfig.cmake. We should also need to take into accountLLVM_LIBDIR_SUFFIX.Follows up on:
builtin_clang=OFF#18386