aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/enet
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/enet')
-rw-r--r--vcpkg/ports/enet/fix-export.patch31
-rw-r--r--vcpkg/ports/enet/portfile.cmake23
-rw-r--r--vcpkg/ports/enet/vcpkg.json16
3 files changed, 70 insertions, 0 deletions
diff --git a/vcpkg/ports/enet/fix-export.patch b/vcpkg/ports/enet/fix-export.patch
new file mode 100644
index 0000000..89fec84
--- /dev/null
+++ b/vcpkg/ports/enet/fix-export.patch
@@ -0,0 +1,31 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c6459b6..63aef98 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -89,14 +89,25 @@ add_library(enet STATIC
+ ${SOURCE_FILES}
+ )
+
++target_include_directories(enet PUBLIC
++ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
++ $<INSTALL_INTERFACE:include>
++)
++
+ if (MINGW)
+ target_link_libraries(enet winmm ws2_32)
+ endif()
+
+ install(TARGETS enet
++ EXPORT unofficial-enet-config
+ RUNTIME DESTINATION bin
+- ARCHIVE DESTINATION lib/static
++ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+
++INSTALL(EXPORT unofficial-enet-config
++ NAMESPACE unofficial::enet::
++ DESTINATION share/unofficial-enet
++)
++
+ install(DIRECTORY include/
+ DESTINATION include)
diff --git a/vcpkg/ports/enet/portfile.cmake b/vcpkg/ports/enet/portfile.cmake
new file mode 100644
index 0000000..399fe12
--- /dev/null
+++ b/vcpkg/ports/enet/portfile.cmake
@@ -0,0 +1,23 @@
+vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH
+ REPO "lsalzman/enet"
+ REF "v${VERSION}"
+ HEAD_REF master
+ SHA512 a0d2fa8c957704dd49e00a726284ac5ca034b50b00d2b20a94fa1bbfbb80841467834bfdc84aa0ed0d6aab894608fd6c86c3b94eee46343f0e6d9c22e391dbf9
+ PATCHES fix-export.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
+ # OPTIONS_RELEASE -DOPTIMIZE=1
+ # OPTIONS_DEBUG -DDEBUGGABLE=1
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-enet CONFIG_PATH share/unofficial-enet)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_copy_pdbs()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/enet/vcpkg.json b/vcpkg/ports/enet/vcpkg.json
new file mode 100644
index 0000000..c85c7f1
--- /dev/null
+++ b/vcpkg/ports/enet/vcpkg.json
@@ -0,0 +1,16 @@
+{
+ "name": "enet",
+ "version": "1.3.18",
+ "description": "Reliable UDP networking library",
+ "homepage": "https://github.com/lsalzman/enet",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}