From 6093c011ab27a91d18680c3d8fcf4bd6381d0616 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 25 Feb 2020 16:36:56 +0100 Subject: [PATCH] Always write the cross_file using the same name. Even if we use different template for different platform, we must always use the same cross_file name. --- kiwixbuild/platforms/android.py | 2 +- kiwixbuild/platforms/base.py | 6 ++++-- kiwixbuild/platforms/i586.py | 2 +- kiwixbuild/platforms/ios.py | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/kiwixbuild/platforms/android.py b/kiwixbuild/platforms/android.py index 036cfed..acb24b6 100644 --- a/kiwixbuild/platforms/android.py +++ b/kiwixbuild/platforms/android.py @@ -87,7 +87,7 @@ class AndroidPlatformInfo(PlatformInfo): def finalize_setup(self): super().finalize_setup() - self.buildEnv.cmake_crossfile = self._gen_crossfile('cmake_android_cross_file.txt') + self.buildEnv.cmake_crossfile = self._gen_crossfile('cmake_android_cross_file.txt', 'cmake_cross_file.txt') self.buildEnv.meson_crossfile = self._gen_crossfile('meson_cross_file.txt') diff --git a/kiwixbuild/platforms/base.py b/kiwixbuild/platforms/base.py index 782fc5e..93009db 100644 --- a/kiwixbuild/platforms/base.py +++ b/kiwixbuild/platforms/base.py @@ -94,8 +94,10 @@ class PlatformInfo(metaclass=_MetaPlatform): env['CXXFLAGS'] = env['CXXFLAGS'] + ' -fPIC' - def _gen_crossfile(self, name): - crossfile = pj(self.buildEnv.build_dir, name) + def _gen_crossfile(self, name, outname=None): + if outname is None: + outname = name + crossfile = pj(self.buildEnv.build_dir, outname) template_file = pj(TEMPLATES_DIR, name) with open(template_file, 'r') as f: template = f.read() diff --git a/kiwixbuild/platforms/i586.py b/kiwixbuild/platforms/i586.py index 5dba476..13f2890 100644 --- a/kiwixbuild/platforms/i586.py +++ b/kiwixbuild/platforms/i586.py @@ -53,7 +53,7 @@ class I586PlatformInfo(PlatformInfo): def finalize_setup(self): super().finalize_setup() - self.buildEnv.cmake_crossfile = self._gen_crossfile('cmake_i586_cross_file.txt') + self.buildEnv.cmake_crossfile = self._gen_crossfile('cmake_i586_cross_file.txt', 'cmake_cross_file.txt') self.buildEnv.meson_crossfile = self._gen_crossfile('meson_cross_file.txt') class I586Dyn(I586PlatformInfo): diff --git a/kiwixbuild/platforms/ios.py b/kiwixbuild/platforms/ios.py index 2fc379b..c9da7f1 100644 --- a/kiwixbuild/platforms/ios.py +++ b/kiwixbuild/platforms/ios.py @@ -27,8 +27,8 @@ class iOSPlatformInfo(PlatformInfo): def finalize_setup(self): super().finalize_setup() - self.buildEnv.cmake_crossfile = self._gen_crossfile('cmake_ios_cross_file.txt') - self.buildEnv.meson_crossfile = self._gen_crossfile('meson_ios_cross_file.txt') + self.buildEnv.cmake_crossfile = self._gen_crossfile('cmake_ios_cross_file.txt', 'cmake_cross_file.txt') + self.buildEnv.meson_crossfile = self._gen_crossfile('meson_ios_cross_file.txt', 'meson_cross_file.txt') def get_cross_config(self): return {