3333 'variables' : {
3434 # Location of Android NDK.
3535 'variables' : {
36- 'variables' : {
37- 'android_ndk_root%' : '<!(/bin/echo -n $ANDROID_NDK_ROOT)' ,
38-
39- # Switch between different build types, currently only '0' is
40- # supported.
41- 'android_build_type%' : 0 ,
42- },
43- 'android_ndk_root%' : '<(android_ndk_root)' ,
44- 'android_ndk_sysroot' : '<(android_ndk_root)/platforms/android-9/arch-<(android_target_arch)' ,
45- 'android_build_type%' : '<(android_build_type)' ,
36+ 'android_ndk_root%' : '<!(/bin/echo -n $ANDROID_NDK_ROOT)' ,
37+ 'android_toolchain%' : '<!(/bin/echo -n $ANDROID_TOOLCHAIN)' ,
38+ # Switch between different build types, currently only '0' is
39+ # supported.
40+ 'android_build_type%' : 0 ,
4641 },
47- 'android_ndk_root%' : '<(android_ndk_root)' ,
48- 'android_ndk_sysroot' : '<(android_ndk_sysroot)' ,
49- 'android_ndk_include' : '<(android_ndk_sysroot)/usr/include' ,
50- 'android_ndk_lib' : '<(android_ndk_sysroot)/usr/lib' ,
42+ 'conditions' : [
43+ ['android_ndk_root==""' , {
44+ 'variables' : {
45+ 'android_sysroot' : '<(android_toolchain)/sysroot/' ,
46+ 'android_stlport' : '<(android_toolchain)/sources/cxx-stl/stlport/' ,
47+ },
48+ 'android_include' : '<(android_sysroot)/usr/include' ,
49+ 'android_lib' : '<(android_sysroot)/usr/lib' ,
50+ 'android_stlport_include' : '<(android_stlport)/stlport' ,
51+ 'android_stlport_libs' : '<(android_stlport)/libs' ,
52+ }, {
53+ 'variables' : {
54+ 'android_sysroot' : '<(android_ndk_root)/platforms/android-9/arch-<(android_target_arch)' ,
55+ 'android_stlport' : '<(android_ndk_root)/sources/cxx-stl/stlport/' ,
56+ },
57+ 'android_include' : '<(android_sysroot)/usr/include' ,
58+ 'android_lib' : '<(android_sysroot)/usr/lib' ,
59+ 'android_stlport_include' : '<(android_stlport)/stlport' ,
60+ 'android_stlport_libs' : '<(android_stlport)/libs' ,
61+ }],
62+ ],
5163 # Enable to use the system stlport, otherwise statically
5264 # link the NDK one?
5365 'use_system_stlport%' : '<(android_build_type)' ,
5466 'android_stlport_library' : 'stlport_static' ,
5567 # Copy it out one scope.
5668 'android_build_type%' : '<(android_build_type)' ,
57-
5869 'OS' : 'android' ,
5970 }, # variables
6071 'target_defaults' : {
94105 '-Wno-error=non-virtual-dtor' , # TODO(michaelbai): Fix warnings.
95106 # Note: This include is in cflags to ensure that it comes after
96107 # all of the includes.
97- '-I<(android_ndk_include )' ,
108+ '-I<(android_include )' ,
98109 ],
99110 'defines' : [
100111 'ANDROID' ,
134145 'conditions' : [
135146 ['android_build_type==0' , {
136147 'ldflags' : [
137- '-Wl,-rpath-link=<(android_ndk_lib )' ,
138- '-L<(android_ndk_lib )' ,
148+ '-Wl,-rpath-link=<(android_lib )' ,
149+ '-L<(android_lib )' ,
139150 ],
140151 }],
141152 ['target_arch == "arm"' , {
159170 # The include ordering here is important; change with caution.
160171 ['use_system_stlport==0' , {
161172 'cflags' : [
162- '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport ' ,
173+ '-I<(android_stlport_include) ' ,
163174 ],
164175 'conditions' : [
165176 ['target_arch=="arm" and armv7==1' , {
166177 'ldflags' : [
167- '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs /armeabi-v7a' ,
178+ '-L<(android_stlport_libs) /armeabi-v7a' ,
168179 ],
169180 }],
170181 ['target_arch=="arm" and armv7==0' , {
171182 'ldflags' : [
172- '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs /armeabi' ,
183+ '-L<(android_stlport_libs) /armeabi' ,
173184 ],
174185 }],
175186 ['target_arch=="ia32"' , {
176187 'ldflags' : [
177- '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs /x86' ,
188+ '-L<(android_stlport_libs) /x86' ,
178189 ],
179190 }],
180191 ],
197208 '-Wl,--gc-sections' ,
198209 '-Wl,-z,nocopyreloc' ,
199210 # crtbegin_dynamic.o should be the last item in ldflags.
200- '<(android_ndk_lib )/crtbegin_dynamic.o' ,
211+ '<(android_lib )/crtbegin_dynamic.o' ,
201212 ],
202213 'libraries' : [
203214 # crtend_android.o needs to be the last item in libraries.
204215 # Do not add any libraries after this!
205- '<(android_ndk_lib )/crtend_android.o' ,
216+ '<(android_lib )/crtend_android.o' ,
206217 ],
207218 }],
208219 ['_type=="shared_library"' , {
225236 }],
226237 ], # target_conditions
227238 }, # target_defaults
228- }
239+ }
0 commit comments