-
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build_system: build dronecore_server (including grpc) for iOS and And…
…roid * Needed to fork gRPC for now (in http://github.com/dronecore/grpc) * Added boringssl as a dependency to not rely on the system openssl libs * Plugins need to be built as static libraries for iOS
- Loading branch information
1 parent
f092683
commit 8430308
Showing
20 changed files
with
370 additions
and
110 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
set(DRONECORESERVER_BORINGSSL_SOURCE_DIR "${DRONECORESERVER_EXTERNAL_SOURCE_DIR}/boringssl") | ||
set(DRONECORESERVER_BORINGSSL_BINARY_DIR "${DRONECORESERVER_EXTERNAL_BINARY_DIR}/boringssl") | ||
|
||
include(cmake/helpers/build_target.cmake) | ||
build_target(${DRONECORESERVER_BORINGSSL_SOURCE_DIR} ${DRONECORESERVER_BORINGSSL_BINARY_DIR}) | ||
|
||
# Manually install boringssl | ||
set(OPENSSL_ROOT_DIR ${DRONECORESERVER_BORINGSSL_BINARY_DIR}/install) | ||
|
||
file(MAKE_DIRECTORY ${OPENSSL_ROOT_DIR}) | ||
|
||
file(COPY ${DRONECORESERVER_BORINGSSL_BINARY_DIR}/build/boringssl/src/boringssl/include/openssl DESTINATION ${OPENSSL_ROOT_DIR}) | ||
file(COPY ${DRONECORESERVER_BORINGSSL_BINARY_DIR}/build/boringssl/src/boringssl-build/ssl/libssl.a DESTINATION ${OPENSSL_ROOT_DIR}/lib) | ||
file(COPY ${DRONECORESERVER_BORINGSSL_BINARY_DIR}/build/boringssl/src/boringssl-build/crypto/libcrypto.a DESTINATION ${OPENSSL_ROOT_DIR}/lib) | ||
file(REMOVE ${OPENSSL_ROOT_DIR}/openssl/opensslv.h) |
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
# Set c-ares variables | ||
set(DRONECORESERVER_CARES_SOURCE_DIR "${DRONECORESERVER_EXTERNAL_SOURCE_DIR}/cares") | ||
set(DRONECORESERVER_CARES_BINARY_DIR "${DRONECORESERVER_EXTERNAL_BINARY_DIR}/cares") | ||
set(ENV{DRONECORESERVER_CARES_BINARY_DIR} ${DRONECORESERVER_CARES_BINARY_DIR}) | ||
|
||
# Actually build c-ares | ||
include(cmake/helpers/build_target.cmake) | ||
build_target(${DRONECORESERVER_CARES_SOURCE_DIR} ${DRONECORESERVER_CARES_BINARY_DIR}) | ||
|
||
# Update CMAKE_PREFIX_PATH accordingly | ||
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}:${DRONECORESERVER_CARES_BINARY_DIR}") | ||
set(ENV{CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) | ||
list(APPEND CMAKE_PREFIX_PATH /cares/lib/cmake/c-ares) |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
set(DRONECORESERVER_EXTERNAL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external") | ||
set(DRONECORESERVER_EXTERNAL_BINARY_DIR "${CMAKE_BINARY_DIR}/external") | ||
set(DRONECORESERVER_EXTERNAL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/third_party") | ||
set(DRONECORESERVER_EXTERNAL_BINARY_DIR "${CMAKE_BINARY_DIR}/third_party") | ||
|
||
include(cmake/helpers/build_boringssl.cmake) | ||
include(cmake/helpers/build_protobuf.cmake) | ||
include(cmake/helpers/build_cares.cmake) | ||
include(cmake/helpers/build_grpc.cmake) |
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 |
---|---|---|
@@ -1,24 +1,10 @@ | ||
# Set protobuf variables | ||
set(DRONECORESERVER_PROTOBUF_SOURCE_DIR "${DRONECORESERVER_EXTERNAL_SOURCE_DIR}/protobuf") | ||
set(DRONECORESERVER_PROTOBUF_BINARY_DIR "${DRONECORESERVER_EXTERNAL_BINARY_DIR}/protobuf") | ||
set(ENV{DRONECORESERVER_PROTOBUF_BINARY_DIR} ${DRONECORESERVER_PROTOBUF_BINARY_DIR}) | ||
|
||
# Actually build protobuf | ||
include(cmake/helpers/build_target.cmake) | ||
build_target(${DRONECORESERVER_PROTOBUF_SOURCE_DIR} ${DRONECORESERVER_PROTOBUF_BINARY_DIR}) | ||
|
||
# Include protobuf-config.cmake | ||
find_file( | ||
DRONECORESERVER_PROTOBUF_CMAKE_CONFIG protobuf-config.cmake | ||
PATHS ${DRONECORESERVER_PROTOBUF_BINARY_DIR}/lib/cmake/protobuf ${DRONECORESERVER_PROTOBUF_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/protobuf | ||
) | ||
|
||
if(NOT DRONECORESERVER_PROTOBUF_CMAKE_CONFIG) | ||
message(FATAL_ERROR "Protobuf config file (protobuf-config.cmake) not found!") | ||
endif() | ||
|
||
include(${DRONECORESERVER_PROTOBUF_CMAKE_CONFIG}) | ||
|
||
# Update CMAKE_PREFIX_PATH accordingly | ||
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}:${DRONECORESERVER_PROTOBUF_BINARY_DIR}") | ||
set(ENV{CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) | ||
list(APPEND CMAKE_PREFIX_PATH /protobuf/lib/cmake/protobuf) |
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,68 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
|
||
project(external-boringssl) | ||
|
||
include(ExternalProject) | ||
|
||
set(ARG_GIT_REPOSITORY https://github.com/google/boringssl.git) | ||
set(ARG_GIT_TAG 38c20fe8d514a5328f5db404e116af8e9136c7f8) | ||
|
||
if(ANDROID) | ||
message(STATUS "Preparing external project \"boringssl\" for Android...") | ||
message(STATUS " -- CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}") | ||
message(STATUS " -- ANDROID_ABI: ${ANDROID_ABI}") | ||
message(STATUS " -- ANDROID_STL: ${ANDROID_STL}") | ||
|
||
ExternalProject_add( | ||
boringssl | ||
GIT_REPOSITORY ${ARG_GIT_REPOSITORY} | ||
GIT_TAG ${ARG_GIT_TAG} | ||
PREFIX boringssl | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX:PATH=${BINARY_DIR} | ||
-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE} | ||
-DANDROID_ABI:STRING=${ANDROID_ABI} | ||
-DANDROID_STL:STRING=${ANDROID_STL} | ||
INSTALL_COMMAND true) | ||
elseif(IOS) | ||
message(STATUS "Preparing external project \"boringssl\" for iOS...") | ||
message(STATUS " -- CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}") | ||
message(STATUS " -- IOS_PLATFORM: ${IOS_PLATFORM}") | ||
|
||
ExternalProject_add( | ||
boringssl | ||
GIT_REPOSITORY ${ARG_GIT_REPOSITORY} | ||
GIT_TAG ${ARG_GIT_TAG} | ||
PREFIX boringssl | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX:PATH=${BINARY_DIR} | ||
-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE} | ||
-DIOS_PLATFORM=${IOS_PLATFORM} | ||
-DOPENSSL_NO_ASM=ON # Note: https://github.com/grpc/grpc/issues/9440 | ||
INSTALL_COMMAND true) | ||
else() | ||
# 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 (MSVC) | ||
set(OPENSSL_NO_ASM ON) | ||
else() | ||
set(OPENSSL_NO_ASM OFF) | ||
endif() | ||
|
||
message(STATUS "Preparing external project \"boringssl\"...") | ||
|
||
ExternalProject_add( | ||
boringssl | ||
GIT_REPOSITORY ${ARG_GIT_REPOSITORY} | ||
GIT_TAG ${ARG_GIT_TAG} | ||
PREFIX boringssl | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX:PATH=${BINARY_DIR} | ||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON | ||
-DOPENSSL_NO_ASM=${OPENSSL_NO_ASM} | ||
INSTALL_COMMAND true) | ||
endif() |
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,62 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
|
||
project(external-cares) | ||
|
||
include(ExternalProject) | ||
|
||
set(ARG_GIT_REPOSITORY https://github.com/c-ares/c-ares.git) | ||
set(ARG_GIT_TAG cares-1_13_0) | ||
|
||
if(ANDROID) | ||
message(STATUS "Preparing external project \"c-ares\" for Android...") | ||
message(STATUS " -- CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}") | ||
message(STATUS " -- ANDROID_ABI: ${ANDROID_ABI}") | ||
message(STATUS " -- ANDROID_STL: ${ANDROID_STL}") | ||
|
||
ExternalProject_add( | ||
cares | ||
GIT_REPOSITORY ${ARG_GIT_REPOSITORY} | ||
GIT_TAG ${ARG_GIT_TAG} | ||
PREFIX cares | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX:PATH=${BINARY_DIR} | ||
-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE} | ||
-DANDROID_ABI:STRING=${ANDROID_ABI} | ||
-DANDROID_STL:STRING=${ANDROID_STL} | ||
-DCARES_STATIC=ON | ||
-DCARES_SHARED=OFF | ||
-DCARES_STATIC_PIC=ON | ||
UPDATE_COMMAND "") | ||
elseif(IOS) | ||
message(STATUS "Preparing external project \"c-ares\" for iOS...") | ||
message(STATUS " -- CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}") | ||
message(STATUS " -- IOS_PLATFORM: ${IOS_PLATFORM}") | ||
|
||
ExternalProject_add( | ||
cares | ||
GIT_REPOSITORY ${ARG_GIT_REPOSITORY} | ||
GIT_TAG ${ARG_GIT_TAG} | ||
PREFIX cares | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX:PATH=${BINARY_DIR} | ||
-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE} | ||
-DIOS_PLATFORM=${IOS_PLATFORM} | ||
-DCARES_STATIC=ON | ||
-DCARES_SHARED=OFF | ||
-DCARES_STATIC_PIC=ON | ||
UPDATE_COMMAND "") | ||
else() | ||
message(STATUS "Preparing external project \"c-ares\"...") | ||
|
||
ExternalProject_add( | ||
cares | ||
GIT_REPOSITORY ${ARG_GIT_REPOSITORY} | ||
GIT_TAG ${ARG_GIT_TAG} | ||
PREFIX cares | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX:PATH=${BINARY_DIR} | ||
-DCARES_STATIC=ON | ||
-DCARES_SHARED=OFF | ||
-DCARES_STATIC_PIC=ON | ||
UPDATE_COMMAND "") | ||
endif() |
Oops, something went wrong.