From 32e3b5b5c4aade9324b6b1de891c195064744e3b Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 24 Feb 2020 15:30:31 +0100 Subject: [PATCH 1/2] Fix compilation of kiwix-lib-app. - We should not try to set the cross compilation flags when we use gradle. - Fix anyway the setting of tho cross compilation flags for android sdk platform (the default implementation use the `static` attributes that doesn't exist for android) --- kiwixbuild/dependencies/base.py | 2 +- kiwixbuild/platforms/android.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kiwixbuild/dependencies/base.py b/kiwixbuild/dependencies/base.py index 6581983..270c9e3 100644 --- a/kiwixbuild/dependencies/base.py +++ b/kiwixbuild/dependencies/base.py @@ -524,5 +524,5 @@ class GradleBuilder(Builder): command = command.format( gradle_target=self.gradle_target, gradle_option=self.gradle_option) - env = self.buildEnv.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True) + env = self.buildEnv.get_env(cross_comp_flags=False, cross_compilers=True, cross_path=True) run_command(command, self.build_path, context, env=env) diff --git a/kiwixbuild/platforms/android.py b/kiwixbuild/platforms/android.py index 4029667..036cfed 100644 --- a/kiwixbuild/platforms/android.py +++ b/kiwixbuild/platforms/android.py @@ -145,3 +145,6 @@ class Android(MetaPlatformInfo): env = super().get_env() env['ANDROID_HOME'] = self.sdk_builder.install_path return env + + def set_comp_flags(self, env): + pass From 94c98261c7358fe8db4831776cf6396143a10cfc Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 24 Feb 2020 18:24:07 +0100 Subject: [PATCH 2/2] Fix compilation on different platform in the same time. If we modify the dependency's configure_env, we may change the dictionary with value of the first platform. Then, when we use it for the second platform, the previous values are used. Do not modify the dep_conf_env dictionary and then we are good. --- kiwixbuild/dependencies/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kiwixbuild/dependencies/base.py b/kiwixbuild/dependencies/base.py index 270c9e3..09a5db8 100644 --- a/kiwixbuild/dependencies/base.py +++ b/kiwixbuild/dependencies/base.py @@ -315,12 +315,12 @@ class MakeBuilder(Builder): dep_conf_env = self.configure_env if not dep_conf_env: return - for k in list(dep_conf_env): + for k, v in dep_conf_env.items(): if k.startswith('_format_'): - v = dep_conf_env.pop(k) v = v.format(buildEnv=self.buildEnv, env=env) - dep_conf_env[k[8:]] = v - env.update(dep_conf_env) + env[k[8:]] = v + else: + env[k] = v def _configure(self, context):