-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Optional find dependency in installed cmake config. #7099
Conversation
dd58299
to
1280fa5
Compare
Codecov Report
@@ Coverage Diff @@
## master #7099 +/- ##
=======================================
Coverage 81.59% 81.59%
=======================================
Files 13 13
Lines 3901 3901
=======================================
Hits 3183 3183
Misses 718 718 Continue to review full report at Codecov.
|
@@ -4,7 +4,7 @@ find_package(Threads REQUIRED) | |||
|
|||
set(RABIT_SOURCES | |||
${CMAKE_CURRENT_LIST_DIR}/src/allreduce_base.cc | |||
${CMAKE_CURRENT_LIST_DIR}/src/c_api.cc) | |||
${CMAKE_CURRENT_LIST_DIR}/src/rabit_c_api.cc) |
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.
msvc complains that 2 files having same name might produce incorrect result. So I renamed the c api file and merged the test_io.cc into xgboost.
Following up #6159 . This PR removes
find_dependency
in CMake config and make sure dependencies are private if xgboost is built as shared library (the default).An issue was found during writing another C demo for external memory, where I have to set the project with
CXX
language to get CMake working (but I'm writing a demo for C). AlsoFindNccl
is a custom script in xgboost which is not available as part of CMake, adding it to dependency will break users' code.After the PR we simply include gputreeshap header instead of linking it due to a CMake error saying it's not in the export set when built as a static library.
Other than these, I added a simple script using
readelf
to show that the C demo is not linking anything from the dependency set of xgboost.