-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added install support for Android (installing in android ndk)
- Loading branch information
1 parent
b21faaf
commit 6a83dc2
Showing
30 changed files
with
866 additions
and
112 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
README.html | ||
docs/* | ||
*.dump | ||
|
||
*.bak | ||
|
||
# build directory | ||
build*/ | ||
|
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,9 @@ | ||
[submodule "extern/boost-cmake"] | ||
path = extern/boost-cmake | ||
url = https://github.com/Orphis/boost-cmake.git | ||
[submodule "extern/ENCRYPTO_utils"] | ||
path = extern/ENCRYPTO_utils | ||
url = https://github.com/encryptogroup/ENCRYPTO_utils.git | ||
url = https://github.com/oliver-schick/ENCRYPTO_utils.git | ||
[submodule "extern/OTExtension"] | ||
path = extern/OTExtension | ||
url = https://github.com/encryptogroup/OTExtension.git | ||
url = https://github.com/oliver-schick/OTExtension.git |
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 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,5 @@ | ||
include(CMakeFindDependencyMacro) | ||
set(ORIGINAL_PROJECT_NAME @PROJECT_NAME@) | ||
if(ANDROID) | ||
find_dependency(Android${ORIGINAL_PROJECT_NAME}-${ANDROID_PLATFORM_LEVEL}) | ||
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,60 @@ | ||
option(ABY_BUILD_EXE "Build executables" OFF) | ||
set(ABY_LIBRARY_TYPE ${ABY_LIBRARY_TYPE} CACHE STRING | ||
"[STATIC | SHARED | MODULE] The type of library in which ABY will be built. Default: SHARED" | ||
) | ||
set_property(CACHE ABY_LIBRARY_TYPE PROPERTY STRINGS STATIC SHARED MODULE) | ||
string(TOUPPER "${ABY_LIBRARY_TYPE}" ABY_LIBRARY_TYPE) | ||
if("${ABY_LIBRARY_TYPE}" STREQUAL "") | ||
set(ABY_LIBRARY_TYPE "SHARED") | ||
elseif(NOT "${ABY_LIBRARY_TYPE}" STREQUAL "STATIC" AND | ||
NOT "${ABY_LIBRARY_TYPE}" STREQUAL "SHARED" AND | ||
NOT "${ABY_LIBRARY_TYPE}" STREQUAL "MODULE") | ||
message(WARNING | ||
"Unknown library type: ${ABY_LIBRARY_TYPE}. " | ||
"Setting ABY_LIBRARY_TYPE to default value." | ||
) | ||
set(ABY_LIBRARY_TYPE "SHARED") | ||
endif() | ||
|
||
option(ANDROID "Build for Android") | ||
|
||
set(ABY_DEPENDENCIES_SYSROOT CACHE PATH | ||
[=["Path to the target platform root, where prebuilt ABY dependencies reside " | ||
"Hint: The prebuilt libraries must be built for the current Android ABI. " | ||
"It is not necessary to point to the specific ABI root, if it is a subfolder " | ||
"and the folder's name is equal to the variable ANDROID_ABI for the corresponding ABI" | ||
"(ignored if ANDROID is not set)."]=] | ||
) | ||
set(ANDROID_NDK CACHE PATH | ||
"Path to Android NDK (ignored if ANDROID is not set)." | ||
) | ||
set(ANDROID_ABI CACHE STRING | ||
"Target CPU of android device, like e.g. \"armeabi-v7a\" (ignored if ANDROID is not set)." | ||
) | ||
set(ANDROID_TOOLCHAIN_FILE CACHE FILEPATH | ||
"Android toolchain file (ignored if ANDROID is not set)." | ||
) | ||
mark_as_advanced(ANDROID_TOOLCHAIN_FILE) | ||
if("${ANDROID_TOOLCHAIN_FILE}" STREQUAL "") | ||
set(ANDROID_TOOLCHAIN_FILE "${ANDROID_NDK}/build/cmake/android.toolchain.cmake") | ||
endif() | ||
if(ANDROID AND (NOT EXISTS "${ANDROID_NDK}" OR NOT EXISTS "${ANDROID_TOOLCHAIN_FILE}")) | ||
if(NOT EXISTS "${ANDROID_NDK}") | ||
message(FATAL_ERROR "Path: ${ANDROID_NDK} does not exist.") | ||
elseif(NOT EXISTS "${ANDROID_TOOLCHAIN_FILE}") | ||
message(FATAL_ERROR | ||
"Could not find file: ${ANDROID_TOOLCHAIN_FILE}. " | ||
"Your NDK might be outdated." | ||
) | ||
else() | ||
message(FATAL_ERROR "Unknown error.") | ||
endif() | ||
endif() | ||
|
||
# Set build type to `Release` if none was specified: | ||
# (cf. https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-can-i-change-the-default-build-mode-and-see-it-reflected-in-the-gui) | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release CACHE STRING | ||
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." | ||
FORCE) | ||
endif(NOT CMAKE_BUILD_TYPE) |
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,18 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
find_package(ENCRYPTO_utils QUIET) | ||
if(ENCRYPTO_utils_FOUND) | ||
message(STATUS "Found ENCRYPTO_utils.") | ||
elseif(NOT ENCRYPTO_utils_FOUND AND NOT TARGET ENCRYPTO_utils::encrypto_utils) | ||
set(ENCRYPTO_utils_LIBRARY_TYPE ${ABY_LIBRARY_TYPE}) | ||
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/extern/ENCRYPTO_utils/CMakeLists.txt") | ||
message(STATUS "ENCRYPTO_utils was not found. Fetching ENCRYPTO_utils...") | ||
if(NOT ENCRYPTO_utils_LIBRARY_TYPE) | ||
set(ENCRYPTO_utils_LIBRARY_TYPE ${ABY_LIBRARY_TYPE}) | ||
endif() | ||
include(FetchENCRYPTO_utils) | ||
else() | ||
message(STATUS "ENCRYPTO_utils was found as a submodule. Adding subdirectory.") | ||
add_subdirectory(${PROJECT_SOURCE_DIR}/extern/ENCRYPTO_utils) | ||
endif() | ||
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,33 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
option(FORCE_ENCRYPTO_utils_URL_DOWNLOAD "Force download over URL instead of git." OFF) | ||
set(ENCRYPTO_utils_SOURCE_LOCATION | ||
CACHE PATH | ||
"Path to the ENCRYPTO_utils source." | ||
) | ||
set(ENCRYPTO_utils_REPOSITORY | ||
https://github.com/oliver-schick/ENCRYPTO_utils.git | ||
CACHE STRING | ||
[=["Git repository of 'ENCRYPTO_utils'. If Git is not available on your computer " | ||
"or option FORCE_ENCRYPTO_utils_URL is set, define ENCRYPTO_utils_URL instead."]=] | ||
) | ||
set(ENCRYPTO_utils_GIT_TAG | ||
4c3f1427efa12a971d576faa64861035e01e706d | ||
CACHE STRING | ||
"Git tag of latest verified ENCRYPTO_utils release." | ||
) | ||
set(ENCRYPTO_utils_URL | ||
https://github.com/oliver-schick/ENCRYPTO_utils/archive/4c3f1427efa12a971d576faa64861035e01e706d.zip | ||
CACHE STRING | ||
[=["URL to zip of latest verified ENCRYPTO_utils commit. " | ||
"Ignored if git is available and FORCE_ENCRYPTO_utils_URL is not set."]=] | ||
) | ||
set(ENCRYPTO_utils_URL_HASH | ||
SHA1=832bac4604f34a7b3616949c3a3a69719d5996ac | ||
CACHE STRING | ||
"Hash of contents of ENCRYPTO_utils_URL." | ||
) | ||
mark_as_advanced(FORCE_ENCRYPTO_utils_URL_DOWNLOAD ENCRYPTO_utils_URL ENCRYPTO_utils_URL_HASH) | ||
|
||
include(FetchHelper) | ||
fetch_helper(ENCRYPTO_utils) |
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,45 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
macro(fetch_helper content_name) | ||
string(TOLOWER ${content_name} LOWER_CASE_${content_name}) | ||
if(NOT ${${content_name}_SOURCE_LOCATION} STREQUAL "") | ||
set(FORCE_${content_name}_URL_DOWNLOAD ON) | ||
set(${content_name}_URL_COMMAND | ||
URL ${${content_name}_SOURCE_LOCATION} | ||
) | ||
set(${content_name}_URL_HASH_COMMAND | ||
URL_HASH ${${content_name}_URL_HASH} | ||
) | ||
else() | ||
set(${content_name}_URL_COMMAND | ||
URL ${${content_name}_CMAKE_URL} | ||
) | ||
set(${content_name}_URL_HASH_COMMAND | ||
URL_HASH ${${content_name}_URL_HASH_COMMAND}) | ||
endif() | ||
if(NOT FORCE_${content_name}_URL_DOWNLOAD) | ||
find_package(Git VERSION 1.6.5 QUIET) | ||
endif() | ||
include(FetchContent) | ||
if(Git_FOUND AND NOT FORCE_${content_name}_URL_DOWNLOAD) | ||
FetchContent_Declare(${content_name} | ||
GIT_REPOSITORY ${${content_name}_REPOSITORY} | ||
GIT_TAG ${${content_name}_GIT_TAG} | ||
) | ||
else() | ||
FetchContent_Declare(${content_name} | ||
${${content_name}_URL_COMMAND} | ||
${${content_name}_URL_HASH_COMMAND} | ||
) | ||
endif() | ||
if(NOT LOWER_CASE_${content_name}_POPULATED) | ||
FetchContent_Populate(${content_name}) | ||
if(${ARGV2}) | ||
message(STATUS "Applying patches to ${content_name}.") | ||
include("Patch${content_name}") | ||
endif() | ||
add_subdirectory( | ||
${${LOWER_CASE_${content_name}}_SOURCE_DIR} | ||
${${LOWER_CASE_${content_name}}_BINARY_DIR} | ||
) | ||
endif() | ||
endmacro() |
Submodule ENCRYPTO_utils
updated
33 files
Submodule OTExtension
updated
10 files
+1 −0 | .gitignore | |
+1 −1 | .gitmodules | |
+49 −29 | CMakeLists.txt | |
+5 −0 | cmake/ForwardConfig.cmake.in | |
+18 −0 | cmake/Modules/AddENCRYPTO_utils.cmake | |
+33 −0 | cmake/Modules/FetchENCRYPTO_utils.cmake | |
+45 −0 | cmake/Modules/FetchHelper.cmake | |
+19 −0 | cmake/Modules/OTExtensionCacheVariables.cmake | |
+0 −2 | cmake/OTExtensionConfig.cmake.in | |
+1 −1 | extern/ENCRYPTO_utils |
Submodule boost-cmake
added at
f0f64a
Oops, something went wrong.