diff --git a/ports/usbipdcpp/portfile.cmake b/ports/usbipdcpp/portfile.cmake new file mode 100644 index 00000000000000..4f22faf2e3b47b --- /dev/null +++ b/ports/usbipdcpp/portfile.cmake @@ -0,0 +1,35 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO yunsmall/usbipdcpp + REF "v${VERSION}" + SHA512 cad7d6958d5253d20ecfa23a117cb7ce5f5276b55a46c33386b7f86084dc1f7757c29d1a32862d0f3e4e607392199d3463c8ed967cff247a4b6a1ccae1352dd1 + HEAD_REF main +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + coroutine USBIPDCPP_USE_COROUTINE + libusb USBIPDCPP_BUILD_LIBUSB_COMPONENTS + busywait USBIPDCPP_ENABLE_BUSY_WAIT +) + +vcpkg_find_acquire_program(PKGCONFIG) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" + -DUSBIPDCPP_BUILD_EXAMPLES=OFF + -DUSBIPDCPP_BUILD_TESTS=OFF + ${FEATURE_OPTIONS} + MAYBE_UNUSED_VARIABLES + PKG_CONFIG_EXECUTABLE +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/usbipdcpp) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") \ No newline at end of file diff --git a/ports/usbipdcpp/vcpkg.json b/ports/usbipdcpp/vcpkg.json new file mode 100644 index 00000000000000..32a431c815284d --- /dev/null +++ b/ports/usbipdcpp/vcpkg.json @@ -0,0 +1,33 @@ +{ + "name": "usbipdcpp", + "version": "0.0.1", + "description": "A C++ library for creating usbip servers", + "homepage": "https://github.com/yunsmall/usbipdcpp", + "license": "Apache-2.0", + "dependencies": [ + "asio", + "spdlog", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "coroutine": { + "description": "Use C++20 coroutine-based implementation" + }, + "libusb": { + "description": "Build libusb-based server components for physical USB device forwarding", + "dependencies": [ + "libusb" + ] + }, + "busywait": { + "description": "Enable busy-wait mode for lower latency (incompatible with coroutine)" + } + } +}