Optional find dependency in installed cmake config. (#7099)

* Find dependency only when xgboost is built as static library.
* Resolve msvc warning.
* Add test for linking shared library.
This commit is contained in:
Jiaming Yuan
2021-07-11 17:20:55 +08:00
committed by GitHub
parent 1d91f71119
commit 345796825f
15 changed files with 222 additions and 171 deletions

View File

@@ -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)
if (RABIT_BUILD_MPI)
list(APPEND RABIT_SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/engine_mpi.cc)