Skip to content

Commit

Permalink
[brynet] Use vcpkg_from_github
Browse files Browse the repository at this point in the history
  • Loading branch information
ras0219-msft committed Dec 21, 2017
1 parent 19cb797 commit 31d686e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 29 deletions.
1 change: 0 additions & 1 deletion ports/brynet/CONTROL
@@ -1,4 +1,3 @@
Source: brynet
Version: 0.9.0
Description: A C++ cross platform high performance tcp network library, and support SSL/HTTP/Websocket.
Build-Depends:
40 changes: 12 additions & 28 deletions ports/brynet/portfile.cmake
@@ -1,42 +1,26 @@
# Common Ambient Variables:
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
# PORT = current port name (zlib, etc)
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
#

include(vcpkg_common_functions)

if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(STATUS "Alembic does not support dynamic linkage. Building statically.")
message(STATUS "brynet does not support dynamic linkage. Building statically.")
set(VCPKG_LIBRARY_LINKAGE static)
endif()

set(BRYNET_VERSION 0.9.0)

set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/brynet-${BRYNET_VERSION})
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/IronsDu/brynet/archive/v${BRYNET_VERSION}.zip"
FILENAME "v${BRYNET_VERSION}.zip"
SHA512 a39bdffe6bb9b93bd6f21da0d59b172c2956c5f9366716dff01027f59660ca4d28ee557a42caa93d93047e041438a1de42ed22c67a3c2124d105a63381ac3685
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO IronsDu/brynet
REF v0.9.0
SHA512 49543833be0d8eb2dce2b00a85d48087e9756b93febaae0c7cd83b7f44f9cd8d81976069f8b84344807bee2df785b80fbb65a1a93e8c6a9c942f9554063a05c1
HEAD_REF master
)
vcpkg_extract_source_archive(${ARCHIVE})

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
# OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
# OPTIONS_RELEASE -DOPTIMIZE=1
# OPTIONS_DEBUG -DDEBUGGABLE=1
PREFER_NINJA
)

vcpkg_install_cmake()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(COPY ${CURRENT_BUILDTREES_DIR}/src/brynet-${BRYNET_VERSION}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/brynet)

file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/brynet)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/brynet/LICENSE ${CURRENT_PACKAGES_DIR}/share/brynet/copyright)
# Handle copyright
# file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/brynet RENAME copyright)

0 comments on commit 31d686e

Please sign in to comment.