9
9
10
10
class Arch (object ):
11
11
12
+ include_prefix = None
13
+ '''The prefix for the include dir in the NDK.'''
14
+
12
15
toolchain_prefix = None
13
16
'''The prefix for the toolchain dir in the NDK.'''
14
17
@@ -44,7 +47,7 @@ def get_env(self, with_flags_in_cc=True):
44
47
# post-15 NDK per
45
48
# https://android.googlesource.com/platform/ndk/+/ndk-r15-release/docs/UnifiedHeaders.md
46
49
env ['CFLAGS' ] += ' -isystem {}/sysroot/usr/include/{}' .format (
47
- self .ctx .ndk_dir , self .ctx .toolchain_prefix )
50
+ self .ctx .ndk_dir , self .ctx .include_prefix )
48
51
else :
49
52
sysroot = self .ctx .ndk_platform
50
53
env ['CFLAGS' ] += ' -I{}' .format (self .ctx .ndk_platform )
@@ -67,10 +70,12 @@ def get_env(self, with_flags_in_cc=True):
67
70
if py_platform in ['linux2' , 'linux3' ]:
68
71
py_platform = 'linux'
69
72
73
+ include_prefix = self .ctx .include_prefix
70
74
toolchain_prefix = self .ctx .toolchain_prefix
71
75
toolchain_version = self .ctx .toolchain_version
72
76
command_prefix = self .command_prefix
73
77
78
+ env ['INCLUDE_PREFIX' ] = include_prefix
74
79
env ['TOOLCHAIN_PREFIX' ] = toolchain_prefix
75
80
env ['TOOLCHAIN_VERSION' ] = toolchain_version
76
81
@@ -138,6 +143,7 @@ def get_env(self, with_flags_in_cc=True):
138
143
139
144
class ArchARM (Arch ):
140
145
arch = "armeabi"
146
+ include_prefix = 'arm-linux-androideabi'
141
147
toolchain_prefix = 'arm-linux-androideabi'
142
148
command_prefix = 'arm-linux-androideabi'
143
149
platform_dir = 'arch-arm'
@@ -157,6 +163,7 @@ def get_env(self, with_flags_in_cc=True):
157
163
158
164
class Archx86 (Arch ):
159
165
arch = 'x86'
166
+ include_prefix = 'i686-linux-android'
160
167
toolchain_prefix = 'x86'
161
168
command_prefix = 'i686-linux-android'
162
169
platform_dir = 'arch-x86'
@@ -171,7 +178,8 @@ def get_env(self, with_flags_in_cc=True):
171
178
172
179
class Archx86_64 (Arch ):
173
180
arch = 'x86_64'
174
- toolchain_prefix = 'x86'
181
+ include_prefix = 'x86_64-linux-android'
182
+ toolchain_prefix = 'x86_64'
175
183
command_prefix = 'x86_64-linux-android'
176
184
platform_dir = 'arch-x86'
177
185
@@ -185,6 +193,7 @@ def get_env(self, with_flags_in_cc=True):
185
193
186
194
class ArchAarch_64 (Arch ):
187
195
arch = 'arm64-v8a'
196
+ include_prefix = 'aarch64-linux-android'
188
197
toolchain_prefix = 'aarch64-linux-android'
189
198
command_prefix = 'aarch64-linux-android'
190
199
platform_dir = 'arch-arm64'
0 commit comments