diff --git a/ports/boost-cobalt/features.cmake b/ports/boost-cobalt/features.cmake new file mode 100644 index 0000000000..af32847043 --- /dev/null +++ b/ports/boost-cobalt/features.cmake @@ -0,0 +1,6 @@ +vcpkg_check_features( + OUT_FEATURE_OPTIONS + FEATURE_OPTIONS + FEATURES + "ssl" BOOST_COBALT_ENABLE_IO_SSL +) diff --git a/ports/boost-cobalt/install-cobalt-io.patch b/ports/boost-cobalt/install-cobalt-io.patch new file mode 100644 index 0000000000..5b12e2846f --- /dev/null +++ b/ports/boost-cobalt/install-cobalt-io.patch @@ -0,0 +1,80 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -23,6 +23,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + endif() + + option(BOOST_COBALT_USE_BOOST_CONTAINER "Boost.Cobalt: Use boost.container instead of std::pmr" ${BOOST_COBALT_SHOULD_USE_CONTAINER}) ++option(BOOST_COBALT_ENABLE_IO_SSL "Boost.Cobalt: Build boost_cobalt_io_ssl target" ON) + + if (NOT BOOST_COBALT_IS_ROOT) + # Generated by `boostdep --cmake cobalt` +@@ -112,16 +113,29 @@ if (NOT BOOST_COBALT_IS_ROOT) + target_compile_definitions(boost_cobalt_io PRIVATE BOOST_COBALT_IO_SOURCE=1) + add_library(Boost::cobalt::io ALIAS boost_cobalt_io) + +- find_package(OpenSSL) ++ if (BOOST_COBALT_ENABLE_IO_SSL) ++ find_package(OpenSSL CONFIG REQUIRED) + +- if (OPENSSL_FOUND) +- add_library(boost_cobalt_io_ssl +- src/io/ssl.cpp +- ) ++ add_library(boost_cobalt_io_ssl ++ src/io/ssl.cpp ++ ) ++ ++ target_link_libraries(boost_cobalt_io_ssl PUBLIC boost_cobalt_io OpenSSL::SSL OpenSSL::Crypto) ++ target_compile_definitions(boost_cobalt_io_ssl PRIVATE BOOST_COBALT_SSL_SOURCE=1) ++ add_library(Boost::cobalt::io::ssl ALIAS boost_cobalt_io_ssl) ++ endif() ++ ++ if (BOOST_SUPERPROJECT_VERSION AND NOT CMAKE_VERSION VERSION_LESS 3.13) ++ set(boost_cobalt_install_targets boost_cobalt boost_cobalt_io) ++ if (TARGET boost_cobalt_io_ssl) ++ list(APPEND boost_cobalt_install_targets boost_cobalt_io_ssl) ++ endif() + +- target_link_libraries(boost_cobalt_io_ssl PUBLIC boost_cobalt_io OpenSSL::SSL OpenSSL::Crypto) +- target_compile_definitions(boost_cobalt_io_ssl PRIVATE BOOST_COBALT_SSL_SOURCE=1) +- add_library(Boost::cobalt::io::ssl ALIAS boost_cobalt_io_ssl) ++ boost_install( ++ TARGETS ${boost_cobalt_install_targets} ++ VERSION "${BOOST_SUPERPROJECT_VERSION}" ++ HEADER_DIRECTORY include ++ ) + endif() + + if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") +@@ -244,18 +258,23 @@ else() + target_compile_definitions(boost_cobalt_io PRIVATE BOOST_COBALT_IO_SOURCE=1) + add_library(Boost::cobalt::io ALIAS boost_cobalt_io) + +- find_package(OpenSSL) ++ if (BOOST_COBALT_ENABLE_IO_SSL) ++ find_package(OpenSSL CONFIG REQUIRED) + +- if (OPENSSL_FOUND) +- add_library(boost_cobalt_io_ssl src/io/ssl.cpp) ++ add_library(boost_cobalt_io_ssl src/io/ssl.cpp) + +- target_link_libraries(boost_cobalt_io_ssl PUBLIC boost_cobalt_io OpenSSL::SSL OpenSSL::Crypto) +- target_compile_definitions(boost_cobalt_io_ssl PRIVATE BOOST_COBALT_SSL_SOURCE=1) +- add_library(Boost::cobalt::io::ssl ALIAS boost_cobalt_io_ssl) ++ target_link_libraries(boost_cobalt_io_ssl PUBLIC boost_cobalt_io OpenSSL::SSL OpenSSL::Crypto) ++ target_compile_definitions(boost_cobalt_io_ssl PRIVATE BOOST_COBALT_SSL_SOURCE=1) ++ add_library(Boost::cobalt::io::ssl ALIAS boost_cobalt_io_ssl) + endif() + + if(BOOST_COBALT_INSTALL AND NOT BOOST_SUPERPROJECT_VERSION) +- install(TARGETS boost_cobalt boost_cobalt_io ++ set(boost_cobalt_install_targets boost_cobalt boost_cobalt_io) ++ if (TARGET boost_cobalt_io_ssl) ++ list(APPEND boost_cobalt_install_targets boost_cobalt_io_ssl) ++ endif() ++ ++ install(TARGETS ${boost_cobalt_install_targets} + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" diff --git a/ports/boost-cobalt/portfile.cmake b/ports/boost-cobalt/portfile.cmake index 7d35fa862b..53a38bbee7 100644 --- a/ports/boost-cobalt/portfile.cmake +++ b/ports/boost-cobalt/portfile.cmake @@ -8,9 +8,11 @@ vcpkg_from_github( HEAD_REF master PATCHES fail-on-compiler-not-supported.patch + install-cobalt-io.patch ) set(FEATURE_OPTIONS "") +include("${CMAKE_CURRENT_LIST_DIR}/features.cmake") boost_configure_and_install( SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} diff --git a/ports/boost-cobalt/vcpkg.json b/ports/boost-cobalt/vcpkg.json index 0da7d107ab..e59ec30db7 100644 --- a/ports/boost-cobalt/vcpkg.json +++ b/ports/boost-cobalt/vcpkg.json @@ -2,6 +2,7 @@ "$comment": "Automatically generated by scripts/boost/generate-ports.ps1", "name": "boost-cobalt", "version": "1.91.0", + "port-version": 1, "description": "Boost cobalt module", "homepage": "https://www.boost.org/library/latest/cobalt/", "documentation": "https://www.boost.org/libs/cobalt", @@ -81,5 +82,13 @@ "name": "boost-variant2", "version>=": "1.91.0" } - ] + ], + "features": { + "ssl": { + "description": "Build boost_cobalt_io_ssl", + "dependencies": [ + "openssl" + ] + } + } } diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index 82ab8edba7..9535a3cc76 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -37,6 +37,7 @@ $semverVersion = ($version -replace '(\d+(\.\d+){1,3}).*', '$1') # Clear this array when moving to a new boost version $defaultPortVersion = 0 $portVersions = @{ + 'boost-cobalt' = 1 } function Get-PortVersion { @@ -80,7 +81,15 @@ $portData = @{ }; 'boost-beast' = @{ 'supports' = '!emscripten' }; 'boost-cmake' = @{ 'dependencies' = @(@{ 'name' = 'vcpkg-boost'; 'host' = $true }); }; - 'boost-cobalt' = @{ 'supports' = '!uwp' }; + 'boost-cobalt' = @{ + 'supports' = '!uwp'; + 'features' = @{ + 'ssl' = @{ + 'description' = 'Build boost_cobalt_io_ssl'; + 'dependencies' = @('openssl'); + } + } + }; 'boost-context' = @{ 'supports' = '!uwp & !emscripten' }; 'boost-coroutine' = @{ 'supports' = '!(arm & windows) & !uwp & !emscripten' }; 'boost-dll' = @{ 'supports' = '!uwp' }; diff --git a/versions/b-/boost-cobalt.json b/versions/b-/boost-cobalt.json index b39b2cc0d3..594c721e2c 100644 --- a/versions/b-/boost-cobalt.json +++ b/versions/b-/boost-cobalt.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "e6ce6495e32ceb722705c37c777fd8f2d9068af4", + "version": "1.91.0", + "port-version": 1 + }, { "git-tree": "9ab3cf2522c0d6074ac5455c552610e1f6e3206b", "version": "1.91.0", diff --git a/versions/baseline.json b/versions/baseline.json index 4a48fdc352..bbedccb1bb 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -894,7 +894,7 @@ }, "boost-cobalt": { "baseline": "1.91.0", - "port-version": 0 + "port-version": 1 }, "boost-compat": { "baseline": "1.91.0",