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.
This commit is contained in:
Matthieu Gautier 2021-04-12 18:09:52 +02:00
parent c16a4f5111
commit 76aa746f84
5 changed files with 8 additions and 8 deletions

View File

@ -34,14 +34,10 @@ class Builder:
if option('build_nodeps'): if option('build_nodeps'):
# add all platform steps # add all platform steps
for pltName in PlatformInfo.all_running_platforms: for dep in steps:
plt = PlatformInfo.all_platforms[pltName] stepClass = Dependency.all_deps[dep[1]]
for tlcName in plt.toolchain_names: if stepClass.dont_skip:
tlc = Dependency.all_deps[tlcName] add_target_step(dep, self._targets[dep])
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])
src_targetDef = ('source', targetDef[1]) src_targetDef = ('source', targetDef[1])
add_target_step(src_targetDef, self._targets[src_targetDef]) add_target_step(src_targetDef, self._targets[src_targetDef])

View File

@ -6,6 +6,7 @@ from kiwixbuild.utils import Remotefile, add_execution_right, run_command
pj = os.path.join pj = os.path.join
class android_ndk(Dependency): class android_ndk(Dependency):
dont_skip = True
neutral = False neutral = False
name = 'android-ndk' name = 'android-ndk'
gccver = '4.9.x' gccver = '4.9.x'

View File

@ -7,6 +7,7 @@ from kiwixbuild.utils import Remotefile, run_command
pj = os.path.join pj = os.path.join
class android_sdk(Dependency): class android_sdk(Dependency):
dont_skip = True
neutral = True neutral = True
name = 'android-sdk' name = 'android-sdk'

View File

@ -2,6 +2,7 @@ from .base import Dependency, ReleaseDownload, NoopBuilder
from kiwixbuild.utils import Remotefile from kiwixbuild.utils import Remotefile
class armhf_toolchain(Dependency): class armhf_toolchain(Dependency):
dont_skip = True
neutral = True neutral = True
name = 'armhf' name = 'armhf'

View File

@ -23,6 +23,7 @@ class Dependency(metaclass=_MetaDependency):
all_deps = {} all_deps = {}
force_build = False force_build = False
force_native_build = False force_native_build = False
dont_skip = False
@classmethod @classmethod
def version(cls): def version(cls):