From a273e0d03e415aa7c64326a3236e78c812e04753 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 9 Aug 2010 08:35:02 +0000 Subject: [PATCH] Make 'mark-target-as-explicit' accept multiple target names. [SVN r64689] --- v2/build/project.py | 8 ++------ v2/build/targets.jam | 4 ++-- v2/build/targets.py | 6 +++--- v2/tools/package.py | 4 ++-- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/v2/build/project.py b/v2/build/project.py index cb9132e9f..1739d787a 100644 --- a/v2/build/project.py +++ b/v2/build/project.py @@ -1016,14 +1016,10 @@ attribute is allowed only for top-level 'project' invocations""") attributes.set("projects-to-build", now + dir, exact=True) def explicit(self, target_names): - t = self.registry.current() - for n in target_names: - t.mark_target_as_explicit(n) + self.registry.current().mark_targets_as_explicit(target_names) def always(self, target_names): - p = self.registry.current() - for n in target_names: - p.mark_target_as_always(n) + self.registry.current().mark_targets_as_alays(target_names) def glob(self, wildcards, excludes=None): return self.registry.glob_internal(self.registry.current(), diff --git a/v2/build/targets.jam b/v2/build/targets.jam index f988e691b..a70532ce7 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -297,14 +297,14 @@ class project-target : abstract-target # Add 'target' to the list of targets in this project that should be build # only by explicit request # - rule mark-target-as-explicit ( target-name ) + rule mark-target-as-explicit ( target-name * ) { # Record the name of the target, not instance, since this rule is called # before main target instances are created. self.explicit-targets += $(target-name) ; } - rule mark-target-as-always ( target-name ) + rule mark-target-as-always ( target-name * ) { # Record the name of the target, not instance, since this rule is called # before main target instances are created. diff --git a/v2/build/targets.py b/v2/build/targets.py index a9c0bca50..87f96a4af 100644 --- a/v2/build/targets.py +++ b/v2/build/targets.py @@ -131,7 +131,7 @@ class TargetRegistry: # Inline targets are not built by default. p = t.project() - p.mark_target_as_explicit(name) + p.mark_targets_as_explicit([name]) result.append(name) else: @@ -441,7 +441,7 @@ class ProjectTarget (AbstractTarget): return result - def mark_target_as_explicit (self, target_name): + def mark_targets_as_explicit (self, target_names): """Add 'target' to the list of targets in this project that should be build only by explicit request.""" @@ -449,7 +449,7 @@ class ProjectTarget (AbstractTarget): # rule is called before main target instaces are created. self.explicit_targets_.add(target_name) - def mark_target_as_always(self, target_name): + def mark_targets_as_always(self, target_names): self.always_targets_.add(target_name) def add_alternative (self, target_instance): diff --git a/v2/tools/package.py b/v2/tools/package.py index 5b267a25c..676a4d746 100644 --- a/v2/tools/package.py +++ b/v2/tools/package.py @@ -130,7 +130,7 @@ def install(name, package_name=None, requirements=[], binaries=[], libraries=[], pt = get_manager().projects().current() for subname in ["bin", "lib", "headers", "lib-shared", "lib-static", "lib-shared-universe", "lib-shared-cygwin"]: - pt.mark_target_as_explicit(name + "-" + subname) + pt.mark_targets_as_explicit([name + "-" + subname]) @bjam_signature((["target_name"], ["package_name"], ["data", "*"], ["requirements", "*"])) def install_data(target_name, package_name, data, requirements): @@ -148,7 +148,7 @@ def install_data(target_name, package_name, data, requirements): stage.install(target_name, data, requirements + ["" + os.path.join(datadir, package_name)]) - get_manager().projects().current().mark_target_as_explicit(target_name) + get_manager().projects().current().mark_targets_as_explicit([target_name]) def get_prefix(package_name, requirements):