Support unity build. (#6295)

* Support unity build.

* Setup on Windows Jenkins.

* Revert "Setup on Windows Jenkins."

This reverts commit 8345cb8d2b009eec8ae9fa6f16412a7c9b6ec12c.
This commit is contained in:
Jiaming Yuan
2020-10-29 02:49:28 +08:00
committed by GitHub
parent f6169c0b16
commit c4da967b5c
5 changed files with 11 additions and 15 deletions

View File

@@ -5,6 +5,10 @@ list(REMOVE_ITEM CPU_SOURCES ${xgboost_SOURCE_DIR}/src/cli_main.cc)
# Object library is necessary for jvm-package, which creates its own shared library.
add_library(objxgboost OBJECT)
target_sources(objxgboost PRIVATE ${CPU_SOURCES})
# Skip files with factory object
set_source_files_properties(
predictor/predictor.cc gbm/gbm.cc tree/tree_updater.cc metric/metric.cc objective/objective.cc
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
target_sources(objxgboost PRIVATE ${RABIT_SOURCES})
if (USE_CUDA)

View File

@@ -11,8 +11,8 @@
namespace dmlc {
DMLC_REGISTRY_ENABLE(::xgboost::PredictorReg);
} // namespace dmlc
namespace xgboost {
namespace xgboost {
void PredictionContainer::ClearExpiredEntries() {
std::vector<DMatrix*> expired;
for (auto& kv : container_) {