- const Target::Dependencies &deps = target.get_dependencies();
- for(Target::Dependencies::const_iterator i=deps.begin(); i!=deps.end(); ++i)
- if(const VcxProjectFile *project = dynamic_cast<const VcxProjectFile *>(*i))
- {
- const SourcePackage *pkg = project->get_package();
- IO::print(out, "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"%s\", \"%s\", \"{%s}\"\nEndProject\n",
- pkg->get_name(), project->get_path(), project->get_guid());
- }
+ vector<const VcxProjectFile *> projects;
+ for(const Target *t: solution.get_dependencies())
+ if(const VcxProjectFile *project = dynamic_cast<const VcxProjectFile *>(t))
+ projects.push_back(project);
+
+ for(const VcxProjectFile *p: projects)
+ {
+ const SourcePackage *pkg = p->get_package();
+ IO::print(out, "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"%s\", \"%s\", \"{%s}\"\nEndProject\n",
+ pkg->get_name(), p->get_path(), p->get_guid());
+ }
+
+ vector<string> build_types = builder.get_build_types();
+ const char *platforms[] = { "x86", "x64" };
+
+ IO::print(out, "Global\n");
+ IO::print(out, "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n");
+ for(const string &t: build_types)
+ for(const char *p: platforms)
+ IO::print(out, "\t\t%s|%s = %s|%s\n", t, p, t, p);
+ IO::print(out, "\tEndGlobalSection\n");
+ IO::print(out, "\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n");
+ for(const VcxProjectFile *p: projects)
+ for(const string &t: build_types)
+ for(const char *f: platforms)
+ {
+ const char *project_platform = (!strcmp(f, "x86") ? "Win32" : f);
+ IO::print(out, "\t\t{%s}.%s|%s.ActiveCfg = %s|%s\n", p->get_guid(), t, f, t, project_platform);
+ if(p->get_package()==&spkg)
+ IO::print(out, "\t\t{%s}.%s|%s.Build.0 = %s|%s\n", p->get_guid(), t, f, t, project_platform);
+ }
+ IO::print(out, "\tEndGlobalSection\n");
+ IO::print(out, "EndGlobal\n");