From f24ecc0912b29ae7b1a11777c8d7783f4b3ecdcc Mon Sep 17 00:00:00 2001 From: Vaclav Slavik Date: Fri, 5 Jul 2013 17:45:17 +0200 Subject: [PATCH] VS: Fix exclusion of projects from solution. If a target wasn't build in some configurations _and_ didn't have these configurations listed in "configurations" (directly or inherited; in any case, quite understandable situation), then the exclusion would be ignored and the generated .sln would keep the corresponding project enabled. Fixed to consider all configurations defined in the whole model. --- src/bkl/plugins/vsbase.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bkl/plugins/vsbase.py b/src/bkl/plugins/vsbase.py index 03187dee..efa5ed32 100644 --- a/src/bkl/plugins/vsbase.py +++ b/src/bkl/plugins/vsbase.py @@ -567,7 +567,7 @@ class AdditionalDepsFolder: pass outf.write("\t\t{%s}.%s|%s.ActiveCfg = %s|%s\n" % (guid, cfg.name, plat, cfgp.name, platp)) else: outf.write("\t\t{%s}.%s|%s.ActiveCfg = %s|%s\n" % (guid, cfg.name, plat, cfgp.name, platp)) - if cfgp not in prj.disabled_configurations: + if cfg not in prj.disabled_configurations: outf.write("\t\t{%s}.%s|%s.Build.0 = %s|%s\n" % (guid, cfg.name, plat, cfgp.name, platp)) outf.write("\tEndGlobalSection\n") outf.write("\tGlobalSection(SolutionProperties) = preSolution\n") @@ -750,7 +750,13 @@ def get_project_object(self, target): warning("target type \"%s\" is not supported by the %s toolset, ignoring", target.type.name, self.name) return None - proj.disabled_configurations = [x.config for x in target.configurations + + # See which configurations this target is explicitly disabled in. + # Notice that we must check _all_ configurations visible in the solution, + # not just the ones used by this target. + all_global_configs = (ConfigurationProxy(target, x) + for x in target.project.configurations.itervalues()) + proj.disabled_configurations = [x.config for x in all_global_configs if not x.should_build()] return proj