aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPark DongHa <luncliff@gmail.com>2019-02-27 03:34:15 +0900
committerPhil Christensen <philc@microsoft.com>2019-02-26 10:34:15 -0800
commit5251a51ab0b67176755542e6e85a5cb96e2f3524 (patch)
treede3d1535a71c26bbdb325e03dd92de4d0791c114
parent7b54d8ec11125d8cdeb48d1431808c1d908d59c4 (diff)
downloadvcpkg-5251a51ab0b67176755542e6e85a5cb96e2f3524.tar.gz
vcpkg-5251a51ab0b67176755542e6e85a5cb96e2f3524.zip
[coroutine] add new port (#5433)
[coroutine] new package
-rw-r--r--ports/coroutine/CONTROL4
-rw-r--r--ports/coroutine/portfile.cmake58
2 files changed, 62 insertions, 0 deletions
diff --git a/ports/coroutine/CONTROL b/ports/coroutine/CONTROL
new file mode 100644
index 000000000..4b193d5bd
--- /dev/null
+++ b/ports/coroutine/CONTROL
@@ -0,0 +1,4 @@
+Source: coroutine
+Version: 1.4.0
+Build-Depends: ms-gsl
+Description: C++ coroutine helper/example library
diff --git a/ports/coroutine/portfile.cmake b/ports/coroutine/portfile.cmake
new file mode 100644
index 000000000..17e7596af
--- /dev/null
+++ b/ports/coroutine/portfile.cmake
@@ -0,0 +1,58 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO luncliff/coroutine
+ REF 1.4
+ SHA512 981c9c728c7888995880a97e8533fa31f41085ef57e1c61e53e555f329d20d4a882d9de724d9e93e3d009dc3fe0669fe4d1af403654a9373e4aab44c933628a3
+ HEAD_REF master
+)
+
+if(${VCPKG_TARGET_ARCHITECTURE} MATCHES x86)
+ message(FATAL_ERROR "This library doesn't support x86 arch. Please use x64 instead or contact maintainer")
+endif()
+
+# package: 'ms-gsl'
+message(STATUS "Using Guideline Support Library at ${CURRENT_INSTALLED_DIR}/include")
+
+set(DLL_LINKAGE false)
+if(${VCPKG_LIBRARY_LINKAGE} MATCHES dynamic)
+ message(STATUS "Using DLL linkage")
+ set(DLL_LINKAGE true)
+endif()
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ # package: 'ms-gsl'
+ -DGSL_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include
+ -DTEST_DISABLED=True
+ -DBUILD_SHARED_LIBS=${DLL_LINKAGE}
+)
+
+vcpkg_install_cmake()
+
+file(
+ INSTALL ${SOURCE_PATH}/LICENSE
+ DESTINATION ${CURRENT_PACKAGES_DIR}/share/coroutine
+ RENAME copyright
+)
+
+if(WIN32 AND DLL_LINKAGE)
+ file(INSTALL ${CURRENT_PACKAGES_DIR}/debug/lib/coroutine.dll
+ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
+ )
+ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/coroutine.dll)
+
+ file(INSTALL ${CURRENT_PACKAGES_DIR}/lib/coroutine.dll
+ DESTINATION ${CURRENT_PACKAGES_DIR}/bin
+ )
+ file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/coroutine.dll)
+endif()
+# removed duplicates in debug
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+
+# unset used variables
+unset(DLL_LINKAGE)