X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvcxprojectgenerator.cpp;h=8535197f03332bd393f8f09a011dc9de0b2d3c59;hb=44c71b05ff282b3ce5a2d71c0f14eed97bfefea6;hp=3f806a091e8d19a043fd3d00bc3614bf7814977f;hpb=70325e0d3996adb97b99d45445a34c9334566803;p=builder.git
diff --git a/source/vcxprojectgenerator.cpp b/source/vcxprojectgenerator.cpp
index 3f806a0..8535197 100644
--- a/source/vcxprojectgenerator.cpp
+++ b/source/vcxprojectgenerator.cpp
@@ -43,13 +43,13 @@ void VcxProjectGenerator::Worker::main()
IO::print(out, "\t\n");
vector build_types = builder.get_build_types();
- const char *platforms[] = { "Win32", "x64", 0 };
- for(const char **i=platforms; *i; ++i)
- for(vector::const_iterator j=build_types.begin(); j!=build_types.end(); ++j)
+ const char *platforms[] = { "Win32", "x64" };
+ for(const char *p: platforms)
+ for(const string &b: build_types)
{
- IO::print(out, "\t\t\n", *j, *i);
- IO::print(out, "\t\t\t%s\n", *j);
- IO::print(out, "\t\t\t%s\n", *i);
+ IO::print(out, "\t\t\n", b, p);
+ IO::print(out, "\t\t\t%s\n", b);
+ IO::print(out, "\t\t\t%s\n", p);
IO::print(out, "\t\t\n");
}
IO::print(out, "\t\n");
@@ -57,42 +57,49 @@ void VcxProjectGenerator::Worker::main()
IO::print(out, "\t\n");
IO::print(out, "\t\t15.0\n");
IO::print(out, "\t\tMakeFileProj\n");
+ IO::print(out, "\t\t{%s}\n", target.get_guid());
IO::print(out, "\t\n");
IO::print(out, "\t\n");
- const Target *world = builder.get_build_graph().get_target("world");
- const Target::Dependencies &world_deps = world->get_dependencies();
const Executable *exe = 0;
- for(Target::Dependencies::const_iterator i=world_deps.begin(); (!exe && i!=world_deps.end()); ++i)
- if((*i)->get_package()==&spkg)
- exe = dynamic_cast(*i);
+ for(const Target *t: builder.get_build_graph().get_target("world")->get_dependencies())
+ if(t->get_package()==&spkg)
+ if((exe = dynamic_cast(t)))
+ break;
const char *argv0 = Application::get_argv0();
- for(const char **i=platforms; *i; ++i)
- for(vector::const_iterator j=build_types.begin(); j!=build_types.end(); ++j)
+ const string &toolchain = builder.get_current_arch().get_toolchain();
+ for(const char *p: platforms)
+ for(const string &b: build_types)
{
- string base_cmd = format("%s --arch=%s --build-type=%s --prefix=%s", argv0, *i, *j, builder.get_prefix());
- IO::print(out, "\t\n", *j, *i);
+ string base_cmd = format("%s --arch=%s-%s --build-type=%s --prefix=%s", argv0, p, toolchain, b, builder.get_prefix());
+ IO::print(out, "\t\n", b, p);
IO::print(out, "\t\tMakeFile\n");
IO::print(out, "\t\t%s\n", base_cmd);
IO::print(out, "\t\t%s -c\n", base_cmd);
IO::print(out, "\t\t%s -B\n", base_cmd);
if(exe)
IO::print(out, "\t\t%s\n", exe->get_path());
- IO::print(out, "\t\t\tv142\n");
IO::print(out, "\t\n");
}
IO::print(out, "\t\n");
- const BuildGraph::TargetMap &targets = builder.get_build_graph().get_targets();
vector sources;
vector includes;
vector others;
- for(BuildGraph::TargetMap::const_iterator i=targets.begin(); i!=targets.end(); ++i)
- if(i->second->get_package()==&spkg && !i->second->is_buildable())
- if(const FileTarget *file = dynamic_cast(i->second))
+ BuildInfo build_info;
+ for(const auto &kvp: builder.get_build_graph().get_targets())
+ if(kvp.second->get_package()==&spkg)
+ {
+ if(kvp.second->is_buildable())
+ {
+ BuildInfo tgt_binfo;
+ kvp.second->collect_build_info(tgt_binfo);
+ build_info.update_from(tgt_binfo, BuildInfo::CHAINED);
+ }
+ else if(const FileTarget *file = dynamic_cast(kvp.second))
{
if(dynamic_cast(file))
{
@@ -105,20 +112,31 @@ void VcxProjectGenerator::Worker::main()
else
others.push_back(file);
}
+ }
+
+ if(!build_info.incpath.empty())
+ {
+ IO::print(out, "\t\n");
+ string path_str;
+ for(const FS::Path &p: build_info.incpath)
+ append(path_str, ";", p.str());
+ IO::print(out, "\t\t%s\n", path_str);
+ IO::print(out, "\t\n");
+ }
IO::print(out, "\t\n");
- for(vector::const_iterator i=sources.begin(); i!=sources.end(); ++i)
- IO::print(out, "\t\t\n", (*i)->get_path());
+ for(const FileTarget *s: sources)
+ IO::print(out, "\t\t\n", s->get_path());
IO::print(out, "\t\n");
IO::print(out, "\t\n");
- for(vector::const_iterator i=includes.begin(); i!=includes.end(); ++i)
- IO::print(out, "\t\t\n", (*i)->get_path());
+ for(const FileTarget *i: includes)
+ IO::print(out, "\t\t\n", i->get_path());
IO::print(out, "\t\n");
IO::print(out, "\t\n");
- for(vector::const_iterator i=others.begin(); i!=others.end(); ++i)
- IO::print(out, "\t\t\n", (*i)->get_path());
+ for(const FileTarget *t: others)
+ IO::print(out, "\t\t\n", t->get_path());
IO::print(out, "\t\n");
IO::print(out, "\t\n");