Skip to content

Commit

Permalink
VS: Fix exclusion of projects from solution.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vslavik committed Jul 5, 2013
1 parent 50b301c commit f24ecc0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/bkl/plugins/vsbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit f24ecc0

Please sign in to comment.