aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libconfig
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libconfig
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libconfig')
-rw-r--r--vcpkg/ports/libconfig/portfile.cmake29
-rw-r--r--vcpkg/ports/libconfig/static-build.diff34
-rw-r--r--vcpkg/ports/libconfig/vcpkg.json16
3 files changed, 79 insertions, 0 deletions
diff --git a/vcpkg/ports/libconfig/portfile.cmake b/vcpkg/ports/libconfig/portfile.cmake
new file mode 100644
index 0000000..02a1993
--- /dev/null
+++ b/vcpkg/ports/libconfig/portfile.cmake
@@ -0,0 +1,29 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO hyperrealm/libconfig
+ REF "v${VERSION}"
+ SHA512 1d9d7b21baf73259c09b503ca02942bdf847741378f8c3d7e138c9b4979c5304aae510595958fe1842b726778cedf2aaeb1844f8b209a61ccb24debea592bd0c
+ HEAD_REF master
+ PATCHES
+ static-build.diff
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_EXAMPLES=OFF
+ -DBUILD_TESTS=OFF
+)
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libconfig)
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libconfig.h" "defined(LIBCONFIG_STATIC)" "1")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libconfig.h++" "defined(LIBCONFIGXX_STATIC)" "1")
+endif()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/libconfig/static-build.diff b/vcpkg/ports/libconfig/static-build.diff
new file mode 100644
index 0000000..b7aef36
--- /dev/null
+++ b/vcpkg/ports/libconfig/static-build.diff
@@ -0,0 +1,34 @@
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index 5f44454..d488e7a 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -49,7 +49,6 @@ set(libinc_cpp
+ libconfig.hh)
+
+ set(libsrc_cpp
+- ${libsrc}
+ libconfigcpp.cc)
+
+ if(MSVC)
+@@ -82,8 +81,10 @@ set_version_info_from_makefile("Makefile.am" ${libname})
+ set_version_info_from_makefile("Makefile.am" ${libname}++)
+
+ if(BUILD_SHARED_LIBS)
++ target_sources(${libname}++ PRIVATE ${libsrc})
+ target_compile_definitions(${libname}++ PRIVATE LIBCONFIG_STATIC)
+ else()
++ target_link_libraries(${libname}++ PRIVATE ${libname})
+ target_compile_definitions(${libname} PUBLIC LIBCONFIG_STATIC)
+ target_compile_definitions(${libname}++ PUBLIC LIBCONFIG_STATIC LIBCONFIGXX_STATIC)
+ endif()
+@@ -134,8 +135,8 @@ if(MSVC)
+ endif()
+
+ if(WIN32)
+- target_link_libraries(${libname} shlwapi)
+- target_link_libraries(${libname}++ shlwapi)
++ target_link_libraries(${libname} PRIVATE shlwapi)
++ target_link_libraries(${libname}++ PRIVATE shlwapi)
+ endif()
+
+ target_include_directories(${libname}
diff --git a/vcpkg/ports/libconfig/vcpkg.json b/vcpkg/ports/libconfig/vcpkg.json
new file mode 100644
index 0000000..76673d9
--- /dev/null
+++ b/vcpkg/ports/libconfig/vcpkg.json
@@ -0,0 +1,16 @@
+{
+ "name": "libconfig",
+ "version": "1.8.1",
+ "description": "C/C++ library for processing configuration files",
+ "homepage": "https://github.com/hyperrealm/libconfig",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}