Skip to content

Commit

Permalink
Sync FindCrypto. Add option to force crypto linkage
Browse files Browse the repository at this point in the history
  • Loading branch information
sbiscigl committed Feb 14, 2024
1 parent 0b6470c commit 65a2373
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ if (LEGACY_BUILD)
option(BUILD_OPTEL_OTLP_BENCHMARKS "Enables building the benchmark tests with open telemetry OTLP clients" OFF)
option(USE_TLS_V1_2 "Set http client to enforce TLS 1.2" ON)
option(USE_TLS_V1_3 "Set http client to enforce TLS 1.3" OFF)
option(AWS_CRYPTO_BUILD_SHARED_LIBS "Forces FindCrypto to use a shared crypto library if found. regardless of the value of BUILD_SHARED_LIBS" OFF)

set(AWS_USER_AGENT_CUSTOMIZATION "" CACHE STRING "User agent extension")
set(AWS_TEST_REGION "US_EAST_1" CACHE STRING "Region to target integration tests against")
Expand Down
9 changes: 8 additions & 1 deletion cmake/Findcrypto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ else()
)

if (NOT crypto_LIBRARY)
if (BUILD_SHARED_LIBS)
if(${AWS_CRYPTO_BUILD_SHARED_LIBS})
message(STATUS "forcing usage of shared crypto")
set(crypto_LIBRARY ${crypto_SHARED_LIBRARY})
elseif (BUILD_SHARED_LIBS)
if (crypto_SHARED_LIBRARY)
set(crypto_LIBRARY ${crypto_SHARED_LIBRARY})
else()
set(crypto_LIBRARY ${crypto_STATIC_LIBRARY})
endif()
else()
if (crypto_STATIC_LIBRARY)
set(crypto_LIBRARY ${crypto_STATIC_LIBRARY})
Expand Down
3 changes: 3 additions & 0 deletions docs/CMake_Parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,6 @@ An override path for where the build system should find the Android NDK. By def

### ANDROID_BUILD_ZLIB
(Defaults to ON) When building for Android, should Zlib be built as well

### AWS_CRYPTO_BUILD_SHARED_LIBS
Forces FindCrypto to use a shared crypto library if found. regardless of the value of BUILD_SHARED_LIBS

0 comments on commit 65a2373

Please sign in to comment.