aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/dmlc
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/dmlc')
-rw-r--r--vcpkg/ports/dmlc/cxx-fix.patch12
-rw-r--r--vcpkg/ports/dmlc/portfile.cmake39
-rw-r--r--vcpkg/ports/dmlc/vcpkg.json23
3 files changed, 74 insertions, 0 deletions
diff --git a/vcpkg/ports/dmlc/cxx-fix.patch b/vcpkg/ports/dmlc/cxx-fix.patch
new file mode 100644
index 0000000..4b3f0d3
--- /dev/null
+++ b/vcpkg/ports/dmlc/cxx-fix.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 46aa280..f66b286 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -59,6 +59,7 @@ if(USE_AZURE)
+ endif()
+
+ add_library(dmlc ${SOURCE})
++target_compile_features(dmlc PUBLIC cxx_std_${CMAKE_CXX_STANDARD})
+
+ # Sanitizer
+ if (DMLC_USE_SANITIZER)
diff --git a/vcpkg/ports/dmlc/portfile.cmake b/vcpkg/ports/dmlc/portfile.cmake
new file mode 100644
index 0000000..16d8195
--- /dev/null
+++ b/vcpkg/ports/dmlc/portfile.cmake
@@ -0,0 +1,39 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO dmlc/dmlc-core
+ REF dfd9365264a060a5096734b7d892e1858b6d2722
+ SHA512 0dc2ecd3c981d88de27bf5184f7b380261335c474934d0db59028adfe75f6b3ee2da5b831135acfaad7943acb3eaa7007c0faf0f14e63b39865354898f64fcea
+ HEAD_REF main
+ PATCHES
+ cxx-fix.patch # from https://github.com/dmlc/dmlc-core/pull/676
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ openmp ENABLE_OPENMP
+)
+
+if(VCPKG_CRT_LINKAGE STREQUAL dynamic)
+ set(DMLC_FORCE_SHARED_CRT ON)
+else()
+ set(DMLC_FORCE_SHARED_CRT OFF)
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS
+ -DDMLC_FORCE_SHARED_CRT=${DMLC_FORCE_SHARED_CRT}
+ -DUSE_OPENMP=${ENABLE_OPENMP}
+)
+
+vcpkg_cmake_install()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/dmlc)
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/dmlc/vcpkg.json b/vcpkg/ports/dmlc/vcpkg.json
new file mode 100644
index 0000000..22652c3
--- /dev/null
+++ b/vcpkg/ports/dmlc/vcpkg.json
@@ -0,0 +1,23 @@
+{
+ "name": "dmlc",
+ "version-date": "2022-06-22",
+ "description": "DMLC-Core is the backbone library to support all DMLC projects, offers the bricks to build efficient and scalable distributed machine learning libraries.",
+ "homepage": "https://github.com/dmlc/dmlc-core",
+ "license": "Apache-2.0",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "openmp": {
+ "description": "Build with openmp"
+ }
+ }
+}