-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[s2n] Update, add openssl dependency #21484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,39 @@ | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO aws/s2n-tls | ||
| REF 4513f8d707a68388990886d353e7cfe46cc6454b # v1.1.1 | ||
| SHA512 6586e330733982ed3b70fd320e63575639d5793d69ffa06b2a46ed487d55d8271b46df611d62cc48410654b394d599de65edd9cdc860dea13255161d843f1f48 | ||
| PATCHES fix-cmake-target-path.patch | ||
| remove-libcrypto-messages.patch | ||
| REF ab9a3be5a8abcbc5bd7bdba662497a717737c838 # v1.3.0 | ||
| SHA512 0150cba56f7940253ffa5af0c27fdc8db08961d4c8a80377d25f588fa8a56249eb02723304969d0fdebe570388545527ee826a3070c21e50e63c4f021d425728 | ||
| PATCHES | ||
| fix-cmake-target-path.patch | ||
| use-openssl-crypto.patch | ||
| ) | ||
|
|
||
| vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
| FEATURES | ||
| tests BUILD_TESTING | ||
| ) | ||
| vcpkg_cmake_configure( | ||
| SOURCE_PATH "${SOURCE_PATH}" | ||
| OPTIONS | ||
| ${FEATURE_OPTIONS} | ||
| ) | ||
|
|
||
| vcpkg_cmake_install() | ||
| vcpkg_copy_pdbs() | ||
| vcpkg_cmake_config_fixup(CONFIG_PATH lib/s2n/cmake) | ||
|
|
||
| if(BUILD_TESTING) | ||
| message(STATUS Testing) | ||
| vcpkg_cmake_build(TARGET test LOGFILE_BASE test) | ||
| endif() | ||
|
|
||
| file(REMOVE_RECURSE | ||
| "${CURRENT_PACKAGES_DIR}/debug/include" | ||
| "${CURRENT_PACKAGES_DIR}/debug/lib/s2n" | ||
| "${CURRENT_PACKAGES_DIR}/lib/s2n" | ||
| ) | ||
|
|
||
| vcpkg_copy_pdbs() | ||
|
|
||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") | ||
| "${CURRENT_PACKAGES_DIR}/debug/share" | ||
| "${CURRENT_PACKAGES_DIR}/lib/s2n" | ||
| "${CURRENT_PACKAGES_DIR}/share/s2n/modules" | ||
| ) | ||
|
|
||
| # Handle copyright | ||
| file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index edbf248..2992a05 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -400,7 +400,7 @@ endif() | ||
| set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) | ||
|
|
||
| if (SEARCH_LIBCRYPTO) | ||
| - find_package(LibCrypto REQUIRED) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's why it fails to build. The cmake found libcrypto in system side instead of vcpkg.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. It failed because it lacked I dropped this find module because it didn't handle:
|
||
| + find_package(OpenSSL COMPONENTS Crypto REQUIRED) | ||
| else() | ||
| if (TARGET crypto) | ||
| message(STATUS "S2N found target: crypto") | ||
| @@ -465,7 +465,7 @@ if (S2N_INTERN_LIBCRYPTO) | ||
| ) | ||
| endif() | ||
| else() | ||
| - target_link_libraries(${PROJECT_NAME} PUBLIC crypto) | ||
| + target_link_libraries(${PROJECT_NAME} PUBLIC OpenSSL::Crypto) | ||
| endif() | ||
|
|
||
| target_link_libraries(${PROJECT_NAME} PUBLIC ${OS_LIBS} m) | ||
| @@ -473,7 +473,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${OS_LIBS} m) | ||
| target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) | ||
| target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/api> $<INSTALL_INTERFACE:include>) | ||
|
|
||
| -target_include_directories(${PROJECT_NAME} PRIVATE $<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>) | ||
| +target_include_directories(${PROJECT_NAME} PRIVATE $<TARGET_PROPERTY:OpenSSL::Crypto,INTERFACE_INCLUDE_DIRECTORIES>) | ||
|
|
||
| if (BUILD_TESTING) | ||
| enable_testing() | ||
| @@ -485,7 +485,7 @@ if (BUILD_TESTING) | ||
| target_include_directories(testss2n PUBLIC tests) | ||
| target_compile_options(testss2n PRIVATE -std=gnu99) | ||
| target_link_libraries(testss2n PUBLIC ${PROJECT_NAME}) | ||
| - target_include_directories(testss2n PUBLIC $<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>) | ||
| + target_include_directories(testss2n PUBLIC $<TARGET_PROPERTY:OpenSSL::Crypto,INTERFACE_INCLUDE_DIRECTORIES>) | ||
|
|
||
| if (S2N_INTERN_LIBCRYPTO) | ||
| # if libcrypto was interned, rewrite libcrypto symbols so use of internal functions will link correctly | ||
| @@ -536,13 +536,13 @@ if (BUILD_TESTING) | ||
|
|
||
| add_executable(s2nc "bin/s2nc.c" "bin/echo.c" "bin/https.c" "bin/common.c") | ||
| target_link_libraries(s2nc ${PROJECT_NAME}) | ||
| - target_include_directories(s2nc PRIVATE $<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>) | ||
| + target_include_directories(s2nc PRIVATE $<TARGET_PROPERTY:OpenSSL::Crypto,INTERFACE_INCLUDE_DIRECTORIES>) | ||
| target_include_directories(s2nc PRIVATE api) | ||
| target_compile_options(s2nc PRIVATE -std=gnu99 -D_POSIX_C_SOURCE=200112L) | ||
|
|
||
| add_executable(s2nd "bin/s2nd.c" "bin/echo.c" "bin/https.c" "bin/common.c") | ||
| target_link_libraries(s2nd ${PROJECT_NAME}) | ||
| - target_include_directories(s2nd PRIVATE $<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>) | ||
| + target_include_directories(s2nd PRIVATE $<TARGET_PROPERTY:OpenSSL::Crypto,INTERFACE_INCLUDE_DIRECTORIES>) | ||
| target_include_directories(s2nd PRIVATE api) | ||
| target_compile_options(s2nd PRIVATE -std=gnu99 -D_POSIX_C_SOURCE=200112L) | ||
|
|
||
| diff --git a/cmake/s2n-config.cmake b/cmake/s2n-config.cmake | ||
| index 4e76ed6..f714df0 100644 | ||
| --- a/cmake/s2n-config.cmake | ||
| +++ b/cmake/s2n-config.cmake | ||
| @@ -5,8 +5,7 @@ if (NOT MSVC) | ||
| find_package(Threads REQUIRED) | ||
| endif() | ||
|
|
||
| -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules") | ||
| -find_dependency(LibCrypto) | ||
| +find_dependency(OpenSSL COMPONENTS Crypto) | ||
|
|
||
| include(${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@-targets.cmake) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.