Skip to content

Commit 9c3df41

Browse files
committed
[[ Bug ]] Set ANDROID_LIB_PATH if unset
1 parent 4a012e5 commit 9c3df41

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

config.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def exec_gyp(args):
146146
def process_env_options(opts):
147147
vars = ('OS', 'PLATFORM', 'GENERATOR_OUTPUT', 'FORMATS', 'DEPTH',
148148
'WIN_MSVS_VERSION', 'XCODE_TARGET_SDK', 'XCODE_HOST_SDK',
149-
'TARGET_ARCH', 'PERL', 'ANDROID_NDK_VERSION',
149+
'TARGET_ARCH', 'PERL', 'ANDROID_NDK_VERSION', 'ANDROID_LIB_PATH',
150150
'ANDROID_NDK_PLATFORM_VERSION', 'ANDROID_PLATFORM',
151151
'ANDROID_SDK', 'ANDROID_NDK', 'ANDROID_BUILD_TOOLS', 'LTO',
152152
'ANDROID_TOOLCHAIN', 'ANDROID_API_VERSION',
@@ -650,6 +650,13 @@ def android_tool(name, env, extra=""):
650650
cflags = android_extra_cflags(target_arch)
651651
ldflags = android_extra_ldflags(target_arch)
652652

653+
if opts['ANDROID_LIB_PATH'] is None:
654+
dir =guess_standalone_toolchain_dir_name(opts['TARGET_ARCH'])
655+
if dir is None:
656+
error('Android standalone toolchain not found for architecture {}'.format(opts['TARGET_ARCH']))
657+
658+
opts['ANDROID_LIB_PATH'] = os.path.join(dir,triple,'lib')
659+
653660
# All Android builds use Clang and make a lot of noise about unused
654661
# arguments (e.g. linker-specific arguments). Suppress them.
655662
cflags += ' -Qunused-arguments'
@@ -751,7 +758,7 @@ def configure_android(opts):
751758
export_opts(opts, ('ANDROID_BUILD_TOOLS', 'ANDROID_NDK',
752759
'ANDROID_PLATFORM', 'ANDROID_SDK',
753760
'ANDROID_NDK_VERSION', 'ANDROID_NDK_PLATFORM_VERSION',
754-
'ANDROID_API_VERSION',
761+
'ANDROID_API_VERSION', 'ANDROID_LIB_PATH',
755762
'JAVA_SDK', 'AR', 'CC', 'CXX', 'LINK', 'OBJCOPY',
756763
'OBJDUMP', 'STRIP'))
757764
args = core_gyp_args(opts) + ['-Dtarget_arch=' + opts['TARGET_ARCH'],

0 commit comments

Comments
 (0)