Skip to content

Commit

Permalink
Fix build platform hardcoded flags for archs.py
Browse files Browse the repository at this point in the history
  • Loading branch information
opacam committed Jan 16, 2019
1 parent 5dccf9f commit f570def
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pythonforandroid/archs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from distutils.spawn import find_executable

from pythonforandroid.recipe import Recipe
from pythonforandroid.util import BuildInterruptingException
from pythonforandroid.util import BuildInterruptingException, build_platform


class Arch(object):
Expand Down Expand Up @@ -51,7 +51,8 @@ def get_env(self, with_flags_in_cc=True, clang=False):
toolchain = '{android_host}-{toolchain_version}'.format(
android_host=self.ctx.toolchain_prefix,
toolchain_version=self.ctx.toolchain_version)
toolchain = join(self.ctx.ndk_dir, 'toolchains', toolchain, 'prebuilt', 'linux-x86_64')
toolchain = join(self.ctx.ndk_dir, 'toolchains', toolchain,
'prebuilt', build_platform)
cflags.append('-gcc-toolchain {}'.format(toolchain))

env['CFLAGS'] = ' '.join(cflags)
Expand Down Expand Up @@ -106,7 +107,7 @@ def get_env(self, with_flags_in_cc=True, clang=False):
llvm_dirname = split(
glob(join(self.ctx.ndk_dir, 'toolchains', 'llvm*'))[-1])[-1]
clang_path = join(self.ctx.ndk_dir, 'toolchains', llvm_dirname,
'prebuilt', 'linux-x86_64', 'bin')
'prebuilt', build_platform, 'bin')
environ['PATH'] = '{clang_path}:{path}'.format(
clang_path=clang_path, path=environ['PATH'])
exe = join(clang_path, 'clang')
Expand Down

0 comments on commit f570def

Please sign in to comment.