1cmake_minimum_required(VERSION 3.4.1) 2add_library(conscrypt_jni 3 SHARED 4 ../common/src/jni/main/cpp/conscrypt/compatibility_close_monitor.cc 5 ../common/src/jni/main/cpp/conscrypt/jniload.cc 6 ../common/src/jni/main/cpp/conscrypt/jniutil.cc 7 ../common/src/jni/main/cpp/conscrypt/native_crypto.cc 8 ../common/src/jni/main/cpp/conscrypt/netutil.cc 9 ../common/src/jni/main/cpp/conscrypt/trace.cc 10 ) 11include_directories(../common/src/jni/main/include/ 12 ../common/src/jni/unbundled/include/ 13 ${BORINGSSL_HOME}/include) 14 15find_library(android-log-lib log) 16target_link_libraries(conscrypt_jni ${android-log-lib} ssl crypto) 17 18add_definitions(-DANDROID 19 -fvisibility=hidden 20 -DBORINGSSL_SHARED_LIBRARY 21 -DBORINGSSL_IMPLEMENTATION 22 -DOPENSSL_SMALL 23 -D_XOPEN_SOURCE=700 24 -Wno-unused-parameter 25 # The following two lines are taken from BoringSSL's build file. As written there: 26 # 27 # Clang's -Wtautological-constant-compare is far too aggressive and does not 28 # account for, say, wanting the same code to work on both 32-bit and 64-bit 29 # platforms. 30 # 31 # TODO: Remove these when the NDK no longer includes a version that has 32 # -Wtautological-constant-compare enabled as part of -Wall 33 -Wno-tautological-constant-compare 34 -Wtautological-constant-out-of-range-compare) 35 36if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") 37 set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -march=armv8-a+crypto") 38endif() 39 40add_subdirectory(${BORINGSSL_HOME} ${CMAKE_CURRENT_BINARY_DIR}/boringssl) 41