aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/nng
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/nng
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/nng')
-rw-r--r--vcpkg/ports/nng/portfile.cmake55
-rw-r--r--vcpkg/ports/nng/vcpkg.json29
2 files changed, 84 insertions, 0 deletions
diff --git a/vcpkg/ports/nng/portfile.cmake b/vcpkg/ports/nng/portfile.cmake
new file mode 100644
index 0000000..6bb0537
--- /dev/null
+++ b/vcpkg/ports/nng/portfile.cmake
@@ -0,0 +1,55 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO nanomsg/nng
+ REF "v${VERSION}"
+ SHA512 cceedb16ecc3849f49b76a2ebfee4ba46a6d22b429aa9a5a94354c92aa643c5dcffd325f854ecba8ebe341c514f8288576a7be392f3a03a69152873fdd277fe3
+ HEAD_REF master
+)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ mbedtls NNG_ENABLE_TLS
+ tools NNG_ENABLE_NNGCAT
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DNNG_TESTS=OFF
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/nng)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_replace_string(
+ "${CURRENT_PACKAGES_DIR}/include/nng/nng.h"
+ "defined(NNG_SHARED_LIB)"
+ "0 /* defined(NNG_SHARED_LIB) */"
+)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ vcpkg_replace_string(
+ "${CURRENT_PACKAGES_DIR}/include/nng/nng.h"
+ "!defined(NNG_STATIC_LIB)"
+ "1 /* !defined(NNG_STATIC_LIB) */"
+ )
+else()
+ vcpkg_replace_string(
+ "${CURRENT_PACKAGES_DIR}/include/nng/nng.h"
+ "!defined(NNG_STATIC_LIB)"
+ "0 /* !defined(NNG_STATIC_LIB) */"
+ )
+endif()
+
+if ("tools" IN_LIST FEATURES)
+ vcpkg_copy_tools(TOOL_NAMES nngcat AUTO_CLEAN)
+endif()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
+
+vcpkg_copy_pdbs()
diff --git a/vcpkg/ports/nng/vcpkg.json b/vcpkg/ports/nng/vcpkg.json
new file mode 100644
index 0000000..464d742
--- /dev/null
+++ b/vcpkg/ports/nng/vcpkg.json
@@ -0,0 +1,29 @@
+{
+ "name": "nng",
+ "version": "1.11",
+ "description": "nanomsg-next-gen, lightweight messaging library",
+ "homepage": "https://nng.nanomsg.org",
+ "license": "MIT",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "mbedtls": {
+ "description": "nng TLS support",
+ "dependencies": [
+ "mbedtls"
+ ]
+ },
+ "tools": {
+ "description": "nng tools (nngcat, for example)"
+ }
+ }
+}