Skip to content

Commit a5c4e15

Browse files
committed
Merge pull request #840 from leapmotion/fix-android2
Fix toolchain file again
2 parents c972b4a + 0811f35 commit a5c4e15

File tree

5 files changed

+23
-18
lines changed

5 files changed

+23
-18
lines changed

CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ project(autowiring VERSION ${autowiring_VERSION})
55
include(CTest)
66
include(CheckTypeSize)
77

8+
message(STATUS "sizeof(void*) is ${CMAKE_SIZEOF_VOID_P}")
9+
810
if(APPLE)
911
option(autowiring_BUILD_FAT "Build fat binaries for Autowiring" ON)
1012
set(CMAKE_OSX_ARCHITECTURES "x86_64;i386" CACHE STRING "Mac OS X build architectures" FORCE)
@@ -162,7 +164,7 @@ install(
162164
COMPONENT autowiring
163165
FILES_MATCHING PATTERN "*.h"
164166
)
165-
167+
166168
# Install autoboost headers on ARM, which still requires them
167169
if(CMAKE_COMPILER_IS_GNUCC AND ("${CMAKE_CXX_COMPILER}" MATCHES "androideabi"))
168170
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
@@ -173,7 +175,7 @@ if(CMAKE_COMPILER_IS_GNUCC AND ("${CMAKE_CXX_COMPILER}" MATCHES "androideabi"))
173175
)
174176
endif()
175177
endif()
176-
178+
177179
# Targets file is needed in order to describe how to link Autowiring to the rest of the system
178180
install(EXPORT AutowiringTargets FILE AutowiringTargets.cmake COMPONENT autowiring NAMESPACE Autowiring:: DESTINATION cmake CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
179181

contrib/autoboost/autoboost/thread/pthread/thread_data.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
#include <vector>
2525
#include <utility>
2626

27-
#if defined(__ANDROID__)
28-
#include <asm/page.h> // http://code.google.com/p/android/issues/detail?id=39983
29-
#endif
3027

3128
#include <pthread.h>
3229
#include <unistd.h>

toolchain-android.cmake

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
if(BUILD_64_BIT) # ARMv8 with GCC 4.9
2-
set(BUILD_ANDROID64 1)
3-
set(ANDROID_NDK_TOOL_PREFIX aarch64-linux-android)
4-
set(_ndk_suffix -4.9-aarch64)
5-
else() # GCC 4.8
6-
set(ARM_TARGET "armeabi-v7a")
7-
set(ANDROID_NDK_TOOL_PREFIX arm-linux-androideabi)
1+
if(NOT ANDROID_NDK_TOOL_PREFIX)
2+
# Default to the 32-bit toolchain version for legacy compatibility
3+
if(0.9.0 VERSION_LESS autowiring_VERSION)
4+
message(FATAL_ERROR "Eliminate this compatibility hack")
5+
endif()
6+
7+
if($ENV{ARMv8})
8+
include(${CMAKE_CURRENT_LIST_DIR}/toolchain-android64.cmake)
9+
else()
10+
include(${CMAKE_CURRENT_LIST_DIR}/toolchain-android32.cmake)
11+
endif()
12+
return()
813
endif()
9-
set(BUILD_ANDROID 1)
14+
1015
set(CMAKE_SYSTEM_NAME Linux)
1116
set(CMAKE_SYSTEM_PROCESSOR arm)
1217
set(CMAKE_SYSTEM_VERSION 1)
13-
set(BUILD_ARM 1)
14-
15-
if(MSYS)
16-
set(_exe_suffix .exe)
17-
endif()
1818

1919
#For reasons beyond my comprehension, this file is parsed multiple times
2020
#and in some of them, cache variables are not preserved so we have to store

toolchain-android32.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set(ARM_TARGET "armeabi-v7a")
2+
set(ANDROID_NDK_TOOL_PREFIX arm-linux-androideabi)
3+
include(${CMAKE_CURRENT_LIST_DIR}/toolchain-android.cmake)

toolchain-android64.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set(ANDROID_NDK_TOOL_PREFIX aarch64-linux-android)
2+
set(_ndk_suffix -4.9-aarch64)
3+
include(${CMAKE_CURRENT_LIST_DIR}/toolchain-android.cmake)

0 commit comments

Comments
 (0)