Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pythonforandroid/archs.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def get_env(self, with_flags_in_cc=True):

# Custom linker options
env['LDSHARED'] = env['CC'] + ' ' + ' '.join(self.common_ldshared)
env['LDCXXSHARED'] = env['CXX'] + ' ' + ' '.join(self.common_ldshared)

# Host python (used by some recipes)
hostpython_recipe = Recipe.get_recipe(
Expand Down
5 changes: 0 additions & 5 deletions pythonforandroid/recipes/greenlet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,5 @@ class GreenletRecipe(PyProjectRecipe):
depends = ['setuptools']
call_hostpython_via_targetpython = False

def get_recipe_env(self, arch, **kwargs):
env = super().get_recipe_env(arch, **kwargs)
env['LDCXXSHARED'] = env['CXX'] + ' -shared'
return env


recipe = GreenletRecipe()
3 changes: 1 addition & 2 deletions pythonforandroid/recipes/kiwisolver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ class KiwiSolverRecipe(PyProjectRecipe):
need_stl_shared = True

def get_recipe_env(self, arch, **kwargs):
"""Override compile and linker flags, refs: #3115 and #3122"""
"""Add the Python include path, refs: #3115."""
env = super().get_recipe_env(arch, **kwargs)
flags = " -I" + self.ctx.python_recipe.include_root(arch.arch)
env["CFLAGS"] += flags
env["CPPFLAGS"] += flags
env["LDFLAGS"] += " -shared"
return env


Expand Down
5 changes: 0 additions & 5 deletions pythonforandroid/recipes/materialyoucolor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,5 @@ class MaterialyoucolorRecipe(PyProjectRecipe):
version = "2.0.10"
url = "https://github.com/T-Dynamos/materialyoucolor-python/releases/download/v{version}/materialyoucolor-{version}.tar.gz"

def get_recipe_env(self, arch, **kwargs):
env = super().get_recipe_env(arch, **kwargs)
env['LDCXXSHARED'] = env['CXX'] + ' -shared'
return env


recipe = MaterialyoucolorRecipe()
32 changes: 0 additions & 32 deletions tests/recipes/test_greenlet.py

This file was deleted.

10 changes: 10 additions & 0 deletions tests/test_archs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"CC",
"CXX",
"LDSHARED",
"LDCXXSHARED",
"STRIP",
"MAKE",
"READELF",
Expand Down Expand Up @@ -62,6 +63,7 @@ def setUp(self):
recipes=["python3", "kivy"],
archs=[self.TEST_ARCH],
)
self.ctx.recipe_build_order = self.ctx.bootstrap.distribution.recipes
self.ctx.python_recipe = Recipe.get_recipe("python3", self.ctx)
# Here we define the expected compiler, which, as per ndk >= r19,
# should be the same for all the tests (no more gcc compiler)
Expand Down Expand Up @@ -134,6 +136,10 @@ def test_arch_arm(self, mock_ensure_dir, mock_shutil_which):
# check gcc compilers
self.assertEqual(env["CC"].split()[0], self.expected_compiler)
self.assertEqual(env["CXX"].split()[0], self.expected_compiler + "++")
self.assertEqual(
env["LDCXXSHARED"],
env["CXX"] + " " + " ".join(arch.common_ldshared),
)
# check android binaries
self.assertEqual(
env["STRIP"].split()[0],
Expand All @@ -159,6 +165,10 @@ def test_arch_arm(self, mock_ensure_dir, mock_shutil_which):
self.ctx.ccache = "/usr/bin/ccache"
env = arch.get_env(with_flags_in_cc=False)
self.assertNotIn(env["CFLAGS"], env["CC"])
self.assertEqual(
env["LDCXXSHARED"],
env["CXX"] + " " + " ".join(arch.common_ldshared),
)
self.assertEqual(env["USE_CCACHE"], "1")
self.assertEqual(env["NDK_CCACHE"], "/usr/bin/ccache")

Expand Down
Loading