-
-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to use boringssl instead of openssl for https on Android
- Loading branch information
1 parent
ce9d3a3
commit f9ed83e
Showing
2 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
|
||
project(external-boringssl) | ||
include(ExternalProject) | ||
|
||
list(APPEND CMAKE_ARGS | ||
"-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}" | ||
"-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}" | ||
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON" | ||
"-DBUILD_SHARED_LIBS=OFF" | ||
) | ||
|
||
if(ANDROID) | ||
list(APPEND CMAKE_ARGS | ||
"-DANDROID_ABI:STRING=${ANDROID_ABI}" | ||
"-DANDROID_STL:STRING=${ANDROID_STL}" | ||
"-DANDROID_PLATFORM=${ANDROID_PLATFORM}" | ||
) | ||
elseif(IOS) | ||
list(APPEND CMAKE_ARGS | ||
"-DIOS_PLATFORM=${IOS_PLATFORM}" | ||
) | ||
endif() | ||
|
||
# We disable ASM optimizations for MSVC and iOS (see above for iOS), which | ||
# might have a performance impact on secure communications. | ||
# This should be benchmarked/evaluated before we decide if it is worth | ||
# enabling them or not in our case. | ||
# | ||
# More information here: https://github.com/grpc/grpc/issues/9440 | ||
#if (IOS OR MSVC) | ||
# list(APPEND CMAKE_ARGS | ||
# "-DOPENSSL_NO_ASM=ON" # Note: https://github.com/grpc/grpc/issues/9440 | ||
# ) | ||
#else() | ||
# list(APPEND CMAKE_ARGS | ||
# "-DOPENSSL_NO_ASM=OFF" # Note: https://github.com/grpc/grpc/issues/9440 | ||
# ) | ||
#endif() | ||
|
||
message(STATUS "Preparing external project \"boringssl\" with args:") | ||
foreach(CMAKE_ARG ${CMAKE_ARGS}) | ||
message(STATUS "-- ${CMAKE_ARG}") | ||
endforeach() | ||
|
||
ExternalProject_add( | ||
boringssl | ||
URL https://github.com/google/boringssl/releases/download/0.20241203.0/boringssl-0.20241203.0.tar.gz | ||
URL_MD5 3320699951028ba64150b5296bc9d0e6 | ||
PREFIX boringssl | ||
CMAKE_ARGS "${CMAKE_ARGS}" | ||
) |