From 76aa746f845da09f003e74e5d9cb1636330a51f8 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 12 Apr 2021 18:09:52 +0200 Subject: [PATCH] Add the `dont_skip` attribute on dependency. Instead of explicitly add the target associated to the toolchain if we use `build_nodeps` option let add an attribute base ourself on it to know if we need to add it or not. This way, we may have other dependency we must not skip. --- kiwixbuild/builder.py | 12 ++++-------- kiwixbuild/dependencies/android_ndk.py | 1 + kiwixbuild/dependencies/android_sdk.py | 1 + kiwixbuild/dependencies/armhf.py | 1 + kiwixbuild/dependencies/base.py | 1 + 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/kiwixbuild/builder.py b/kiwixbuild/builder.py index 304d698..78f8ca3 100644 --- a/kiwixbuild/builder.py +++ b/kiwixbuild/builder.py @@ -34,14 +34,10 @@ class Builder: if option('build_nodeps'): # add all platform steps - for pltName in PlatformInfo.all_running_platforms: - plt = PlatformInfo.all_platforms[pltName] - for tlcName in plt.toolchain_names: - tlc = Dependency.all_deps[tlcName] - src_plt_step = ('source', tlcName) - add_target_step(src_plt_step, self._targets[src_plt_step]) - blt_plt_step = ('neutral' if tlc.neutral else pltName, tlcName) - add_target_step(blt_plt_step, self._targets[blt_plt_step]) + for dep in steps: + stepClass = Dependency.all_deps[dep[1]] + if stepClass.dont_skip: + add_target_step(dep, self._targets[dep]) src_targetDef = ('source', targetDef[1]) add_target_step(src_targetDef, self._targets[src_targetDef]) diff --git a/kiwixbuild/dependencies/android_ndk.py b/kiwixbuild/dependencies/android_ndk.py index 57e0792..fb38a03 100644 --- a/kiwixbuild/dependencies/android_ndk.py +++ b/kiwixbuild/dependencies/android_ndk.py @@ -6,6 +6,7 @@ from kiwixbuild.utils import Remotefile, add_execution_right, run_command pj = os.path.join class android_ndk(Dependency): + dont_skip = True neutral = False name = 'android-ndk' gccver = '4.9.x' diff --git a/kiwixbuild/dependencies/android_sdk.py b/kiwixbuild/dependencies/android_sdk.py index 39c1a9e..7319a59 100644 --- a/kiwixbuild/dependencies/android_sdk.py +++ b/kiwixbuild/dependencies/android_sdk.py @@ -7,6 +7,7 @@ from kiwixbuild.utils import Remotefile, run_command pj = os.path.join class android_sdk(Dependency): + dont_skip = True neutral = True name = 'android-sdk' diff --git a/kiwixbuild/dependencies/armhf.py b/kiwixbuild/dependencies/armhf.py index b79735e..35adca3 100644 --- a/kiwixbuild/dependencies/armhf.py +++ b/kiwixbuild/dependencies/armhf.py @@ -2,6 +2,7 @@ from .base import Dependency, ReleaseDownload, NoopBuilder from kiwixbuild.utils import Remotefile class armhf_toolchain(Dependency): + dont_skip = True neutral = True name = 'armhf' diff --git a/kiwixbuild/dependencies/base.py b/kiwixbuild/dependencies/base.py index 3ed677d..71fc967 100644 --- a/kiwixbuild/dependencies/base.py +++ b/kiwixbuild/dependencies/base.py @@ -23,6 +23,7 @@ class Dependency(metaclass=_MetaDependency): all_deps = {} force_build = False force_native_build = False + dont_skip = False @classmethod def version(cls):