Description: De-vendor dmlc-core in CMake config
Author: Mo Zhou <cdluminate@debian.org>
Last-Update: 2024-08-26
Forwarded: not-needed
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: xgboost/CMakeLists.txt
===================================================================
--- xgboost.orig/CMakeLists.txt
+++ xgboost/CMakeLists.txt
@@ -295,7 +295,10 @@ endif()
 
 # dmlc-core
 set(DMLC_FORCE_SHARED_CRT ${FORCE_SHARED_CRT})
-add_subdirectory(${xgboost_SOURCE_DIR}/dmlc-core)
+add_library(dmlc SHARED IMPORTED)
+find_library(DMLC_LIBRARY dmlc)
+set_property(TARGET dmlc PROPERTY IMPORTED_LOCATION "${DMLC_LIBRARY}")
+
 
 if(MSVC)
   if(TARGET dmlc_unit_tests)
@@ -385,7 +388,7 @@ endif()
 #-- End CLI for xgboost
 
 # Common setup for all targets
-foreach(target xgboost objxgboost dmlc)
+foreach(target xgboost objxgboost)
   xgboost_target_properties(${target})
   xgboost_target_link_libraries(${target})
   xgboost_target_defs(${target})
@@ -447,9 +450,9 @@ install(DIRECTORY ${xgboost_SOURCE_DIR}/
 # https://github.com/dmlc/xgboost/issues/6085
 if(BUILD_STATIC_LIB)
   if(BUILD_DEPRECATED_CLI)
-    set(INSTALL_TARGETS xgboost runxgboost objxgboost dmlc)
+    set(INSTALL_TARGETS xgboost runxgboost objxgboost)
   else()
-    set(INSTALL_TARGETS xgboost objxgboost dmlc)
+    set(INSTALL_TARGETS xgboost objxgboost)
   endif()
 else()
   if(BUILD_DEPRECATED_CLI)
