]> git.tdb.fi Git - builder.git/commitdiff
Emit include path in vcxproj files
authorMikko Rasa <tdb@tdb.fi>
Sun, 18 Dec 2022 14:47:30 +0000 (16:47 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 18 Dec 2022 14:47:30 +0000 (16:47 +0200)
source/vcxprojectgenerator.cpp

index c5df4d551c746728b882253981ac5716b5776905..871cde9f9eebfdf4bcc8825c67b5526abf6bfbb5 100644 (file)
@@ -90,9 +90,17 @@ void VcxProjectGenerator::Worker::main()
        vector<const FileTarget *> sources;
        vector<const FileTarget *> includes;
        vector<const FileTarget *> others;
+       BuildInfo build_info;
        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<const FileTarget *>(i->second))
+               if(i->second->get_package()==&spkg)
+               {
+                       if(i->second->is_buildable())
+                       {
+                               BuildInfo tgt_binfo;
+                               i->second->collect_build_info(tgt_binfo);
+                               build_info.update_from(tgt_binfo, BuildInfo::CHAINED);
+                       }
+                       else if(const FileTarget *file = dynamic_cast<const FileTarget *>(i->second))
                        {
                                if(dynamic_cast<const CSourceFile *>(file))
                                {
@@ -105,6 +113,17 @@ void VcxProjectGenerator::Worker::main()
                                else
                                        others.push_back(file);
                        }
+               }
+
+       if(!build_info.incpath.empty())
+       {
+               IO::print(out, "\t<PropertyGroup>\n");
+               string path_str;
+               for(BuildInfo::PathList::const_iterator i=build_info.incpath.begin(); i!=build_info.incpath.end(); ++i)
+                       append(path_str, ";", i->str());
+               IO::print(out, "\t\t<NMakeIncludeSearchPath>%s</NMakeIncludeSearchPath>\n", path_str);
+               IO::print(out, "\t</PropertyGroup>\n");
+       }
 
        IO::print(out, "\t<ItemGroup>\n");
        for(vector<const FileTarget *>::const_iterator i=sources.begin(); i!=sources.end(); ++i)