aboutsummaryrefslogtreecommitdiff
path: root/contrib/depends/toolchain.cmake.in
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-11-03 14:51:52 -0800
committerRiccardo Spagni <ric@spagni.net>2019-11-03 14:51:52 -0800
commitf6201081fa300d53145a29ed91a326b3b0d980bc (patch)
tree7b24087f721432b72ea095029f05a7724cf6c295 /contrib/depends/toolchain.cmake.in
parentMerge pull request #6084 (diff)
parentgitian: add --rebuild option (diff)
downloadmonero-f6201081fa300d53145a29ed91a326b3b0d980bc.tar.xz
Merge pull request #6077
240dbb124 gitian: add --rebuild option (Howard Chu) 643860776 Add Android support (Howard Chu)
Diffstat (limited to 'contrib/depends/toolchain.cmake.in')
-rw-r--r--contrib/depends/toolchain.cmake.in36
1 files changed, 31 insertions, 5 deletions
diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in
index 94902c57a..13018ea26 100644
--- a/contrib/depends/toolchain.cmake.in
+++ b/contrib/depends/toolchain.cmake.in
@@ -1,4 +1,4 @@
-# Set the system name, either Darwin, Linux, or Windows
+# Set the system name to one of Android, Darwin, Linux, or Windows
SET(CMAKE_SYSTEM_NAME @depends@)
SET(CMAKE_BUILD_TYPE @release_type@)
@@ -18,13 +18,14 @@ SET(CMAKE_FIND_ROOT_PATH @prefix@ /usr)
SET(ENV{PKG_CONFIG_PATH} @prefix@/lib/pkgconfig)
-SET(LRELEASE_PATH @prefix@/native/bin CACHE FILEPATH "path to lrelease" FORCE)
-
SET(Readline_ROOT_DIR @prefix@)
SET(Readline_INCLUDE_DIR @prefix@/include)
SET(Readline_LIBRARY @prefix@/lib/libreadline.a)
SET(Terminfo_LIBRARY @prefix@/lib/libtinfo.a)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
+SET(LRELEASE_PATH @prefix@/native/bin CACHE FILEPATH "path to lrelease" FORCE)
+
SET(LIBUNWIND_INCLUDE_DIR @prefix@/include)
SET(LIBUNWIND_LIBRARIES @prefix@/lib/libunwind.a)
SET(LIBUNWIND_LIBRARY_DIRS @prefix@/lib)
@@ -37,6 +38,7 @@ SET(Protobuf_PROTOC_EXECUTABLE @prefix@/native/bin/protoc CACHE FILEPATH "Path t
SET(Protobuf_INCLUDE_DIR @prefix@/include CACHE PATH "Protobuf include dir")
SET(Protobuf_INCLUDE_DIRS @prefix@/include CACHE PATH "Protobuf include dir")
SET(Protobuf_LIBRARY @prefix@/lib/libprotobuf.a CACHE FILEPATH "Protobuf library")
+endif()
SET(ZMQ_INCLUDE_PATH @prefix@/include)
SET(ZMQ_LIB @prefix@/lib/libzmq.a)
@@ -78,6 +80,22 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
SET(CMAKE_OSX_ARCHITECTURES "x86_64")
SET(LLVM_ENABLE_PIC OFF)
SET(LLVM_ENABLE_PIE OFF)
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
+ SET(ANDROID TRUE)
+ if(ARCHITECTURE STREQUAL "arm")
+ SET(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a")
+ SET(CMAKE_SYSTEM_PROCESSOR "armv7-a")
+ SET(CMAKE_ANDROID_ARM_MODE ON)
+ SET(CMAKE_C_COMPILER_TARGET arm-linux-androideabi)
+ SET(CMAKE_CXX_COMPILER_TARGET arm-linux-androideabi)
+ SET(_CMAKE_TOOLCHAIN_PREFIX arm-linux-androideabi-)
+ elseif(ARCHITECTURE STREQUAL "aarch64")
+ SET(CMAKE_ANDROID_ARCH_ABI "arm64-v8a")
+ SET(CMAKE_SYSTEM_PROCESSOR "aarch64")
+ endif()
+ SET(CMAKE_ANDROID_STANDALONE_TOOLCHAIN @prefix@/native)
+ SET(CMAKE_C_COMPILER "${_CMAKE_TOOLCHAIN_PREFIX}clang")
+ SET(CMAKE_CXX_COMPILER "${_CMAKE_TOOLCHAIN_PREFIX}clang++")
else()
SET(CMAKE_C_COMPILER @CC@)
SET(CMAKE_CXX_COMPILER @CXX@)
@@ -89,13 +107,21 @@ if(ARCHITECTURE STREQUAL "arm")
set(ARM_ID "armv7-a")
set(BUILD_64 OFF)
set(CMAKE_BUILD_TYPE release)
- set(BUILD_TAG "linux-armv7")
+ if(ANDROID)
+ set(BUILD_TAG "android-armv7")
+ else()
+ set(BUILD_TAG "linux-armv7")
+ endif()
set(ARM7)
elseif(ARCHITECTURE STREQUAL "aarch64")
set(ARCH "armv8-a")
set(ARM ON)
set(ARM_ID "armv8-a")
- set(BUILD_TAG "linux-armv8")
+ if(ANDROID)
+ set(BUILD_TAG "android-armv8")
+ else()
+ set(BUILD_TAG "linux-armv8")
+ endif()
set(BUILD_64 ON)
endif()