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

@@ -33,7 +33,7 @@ PKG_CXXFLAGS= $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS)
OBJECTS= ./xgboost_R.o ./xgboost_custom.o ./xgboost_assert.o ./init.o \
$(PKGROOT)/amalgamation/xgboost-all0.o $(PKGROOT)/amalgamation/dmlc-minimum0.o \
$(PKGROOT)/rabit/src/engine.o $(PKGROOT)/rabit/src/c_api.o \
$(PKGROOT)/rabit/src/engine.o $(PKGROOT)/rabit/src/rabit_c_api.o \
$(PKGROOT)/rabit/src/allreduce_base.o
$(OBJECTS) : xgblib