diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2019-12-21 04:21:25 +0800 |
|---|---|---|
| committer | dan-shaw <51385773+dan-shaw@users.noreply.github.com> | 2019-12-20 12:21:25 -0800 |
| commit | d36d68deecd209a6f27304f291aa3c1a22346033 (patch) | |
| tree | 9c54e01f15692f187b19406c622926e966521877 | |
| parent | f8cfe6c16462941cfd53b3db9e47e4955e1c1789 (diff) | |
| download | vcpkg-d36d68deecd209a6f27304f291aa3c1a22346033.tar.gz vcpkg-d36d68deecd209a6f27304f291aa3c1a22346033.zip | |
[mongoose] Add feature ssl (#9209)
* [mongoose] Add feature ssl
* [mongoose] Add -D to MG_ENABLE_SSL
| -rw-r--r-- | ports/mongoose/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | ports/mongoose/CONTROL | 6 | ||||
| -rw-r--r-- | ports/mongoose/portfile.cmake | 16 |
3 files changed, 20 insertions, 10 deletions
diff --git a/ports/mongoose/CMakeLists.txt b/ports/mongoose/CMakeLists.txt index 77fe2f839..ae2cce34c 100644 --- a/ports/mongoose/CMakeLists.txt +++ b/ports/mongoose/CMakeLists.txt @@ -4,12 +4,20 @@ project(mongoose C) include(GNUInstallDirs) +option(ENABLE_SSL "Build with openssl support" OFF) + set(CMAKE_INCLUDE_CURRENT_DIR ON) add_library(mongoose mongoose.c) target_include_directories(mongoose PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) set_target_properties(mongoose PROPERTIES PUBLIC_HEADER mongoose.h) +if (ENABLE_SSL) + find_package(OpenSSL REQUIRED) + target_compile_options(mongoose PRIVATE -DMG_ENABLE_SSL) + target_link_libraries(mongoose PRIVATE OpenSSL::SSL OpenSSL::Crypto) +endif() + install(TARGETS mongoose EXPORT unofficial-mongoose-config) install( diff --git a/ports/mongoose/CONTROL b/ports/mongoose/CONTROL index ae0bbc758..c307982cf 100644 --- a/ports/mongoose/CONTROL +++ b/ports/mongoose/CONTROL @@ -1,4 +1,8 @@ Source: mongoose -Version: 6.15-1 +Version: 6.15-2 Description: Embedded web server / embedded networking library Homepage: https://cesanta.com/ + +Feature: ssl +Build-Depends: openssl +Description: Build with openssl
\ No newline at end of file diff --git a/ports/mongoose/portfile.cmake b/ports/mongoose/portfile.cmake index 81c8d50ee..d8dbbaddc 100644 --- a/ports/mongoose/portfile.cmake +++ b/ports/mongoose/portfile.cmake @@ -1,8 +1,4 @@ -include(vcpkg_common_functions) - -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP") -endif() +vcpkg_fail_port_install(ON_TARGET "UWP") vcpkg_check_linkage(ONLY_STATIC_LIBRARY) @@ -16,9 +12,14 @@ vcpkg_from_github( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + ssl ENABLE_SSL +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS ${FEATURE_OPTIONS} ) vcpkg_install_cmake() @@ -28,7 +29,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) - -# CMake integration test -vcpkg_test_cmake(PACKAGE_NAME unofficial-${PORT}) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) |
