[nghttp2] Fix to build nghttp2 statically (#11638)

* fix to build nghttp2 statically.

* review.
This commit is contained in:
thothothotho 2020-06-02 00:59:58 +02:00 committed by GitHub
parent c6414b172a
commit fdff19f9a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -1,4 +1,4 @@
Source: nghttp2 Source: nghttp2
Version: 1.39.2-1 Version: 1.39.2-2
Homepage: https://github.com/nghttp2/nghttp2 Homepage: https://github.com/nghttp2/nghttp2
Description: Implementation of the Hypertext Transfer Protocol version 2 in C Description: Implementation of the Hypertext Transfer Protocol version 2 in C

View File

@ -1,5 +1,3 @@
include(vcpkg_common_functions)
set(LIB_NAME nghttp2) set(LIB_NAME nghttp2)
set(LIB_VERSION 1.39.2) set(LIB_VERSION 1.39.2)
@ -13,12 +11,22 @@ vcpkg_from_github(
HEAD_REF master HEAD_REF master
) )
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(ENABLE_STATIC_LIB ON)
set(ENABLE_SHARED_LIB OFF)
else()
set(ENABLE_STATIC_LIB OFF)
set(ENABLE_SHARED_LIB ON)
endif()
vcpkg_configure_cmake( vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH} SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA PREFER_NINJA
OPTIONS OPTIONS
-DENABLE_LIB_ONLY=ON -DENABLE_LIB_ONLY=ON
-DENABLE_ASIO_LIB=OFF -DENABLE_ASIO_LIB=OFF
-DENABLE_STATIC_LIB=${ENABLE_STATIC_LIB}
-DENABLE_SHARED_LIB=${ENABLE_SHARED_LIB}
) )
vcpkg_install_cmake() vcpkg_install_cmake()
@ -32,6 +40,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif() endif()
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${LIB_NAME} RENAME copyright) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_copy_pdbs() vcpkg_copy_pdbs()