-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[CMake] Update builtin_cling=OFF
configuration code
#18598
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
base: master
Are you sure you want to change the base?
Conversation
In an attempt to further reduce build times, I attempted to build ROOT with `builtin_cling=OFF`, using a custom cling build that I install on my system. However, I ran into several errors with cling header files not being found, as well as linker errors. The simplest fix was to set the `GLOBAL` argument in `find_package(Cling)`, to make all the Cling targets available globally. Then, one also doesn't need all this code for the transient dependencies anymore (this is all handled correctly in the ClingConfig.cmake). The only caveat of this is that the `GLOBAL` argument is only available from CMake 3.24 onwards, so the configuration with `builtin_cling=OFF` will now error out if the CMake version is lower. That should be acceptable, since users that are adventurous enough to build ROOT like this probably also have a CMake version that is new enough (RHEL 9 has CMake version 3.26, and Ubuntu 24.04 has CMake version 3.28). Also, don't add any custom search paths to `find_package(Cling)` and `find_package(Clang)`, so that one is forced to use the `Clang_DIR` and `Cling_DIR` hints correctly.
Test Results 19 files 19 suites 4d 11h 27m 23s ⏱️ Results for commit 15f6743. ♻️ This comment has been updated with latest results. |
Can we improve the Cling cmake infrastructure when it is being discovered as a installed package. I do not think we ever invested time in this and it's probably worth it. |
Which part of the CMake do you mean exactly? With this PR, building ROOT with |
I meant to avoid needing |
@guitargeek I would appreciate if you could start adding me as reviewer for this kind of PRs....... |
In an attempt to further reduce build times, I attempted to build ROOT with
builtin_cling=OFF
, using a custom cling build that I install on my system.However, I ran into several errors with cling header files not being found, as well as linker errors.
The simplest fix was to set the
GLOBAL
argument infind_package(Cling)
, to make all the Cling targets available globally. Then, one also doesn't need all this code for the transient dependencies anymore (this is all handled correctly in the ClingConfig.cmake).The only caveat of this is that the
GLOBAL
argument is only available from CMake 3.24 onwards, so the configuration withbuiltin_cling=OFF
will now error out if the CMake version is lower. That should be acceptable, since users that are adventurous enough to build ROOT like this probably also have a CMake version that is new enough (RHEL 9 has CMake version 3.26, and Ubuntu 24.04 has CMake version 3.28).Also, don't add any custom search paths to
find_package(Cling)
andfind_package(Clang)
, so that one is forced to use theClang_DIR
andCling_DIR
hints correctly.