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 Jan 26, 2024
1 parent 1666358 commit 76d49fe
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ 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(FORCE_SHARED_CRYPTO "Forces FindCrypto to use a shared crypto library if found. regardless of the value of BUILD_SHARED_LIBS" OFF)
option(FORCE_STATIC_CRYPTO "Forces FindCrypto to use a static 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
12 changes: 11 additions & 1 deletion cmake/Findcrypto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,18 @@ else()
)

if (NOT crypto_LIBRARY)
if (BUILD_SHARED_LIBS)
if(${FORCE_SHARED_CRYPTO})
message(STATUS "forcing usage of shared crypto")
set(crypto_LIBRARY ${crypto_SHARED_LIBRARY})
elseif (${FORCE_STATIC_CRYPTO})
message(STATUS "forcing usage of static crypto")
set(crypto_LIBRARY ${crypto_STATIC_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
6 changes: 6 additions & 0 deletions docs/CMake_Parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,9 @@ 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

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

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

0 comments on commit 76d49fe

Please sign in to comment.