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

18
tests/ci_build/verify_link.sh Executable file
View File

@@ -0,0 +1,18 @@
# Make sure the dependencies of XGBoost don't appear in directly downstream project.
# Pass the executable as argument for this script
if readelf -d $1 | grep "omp";
then
echo "Found openmp in direct dependency"
exit -1
else
exit 0
fi
if readelf -d $1 | grep "pthread";
then
echo "Found pthread in direct dependency"
exit -1
else
exit 0
fi