Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: tools/gn/visual_studio_writer.cc

Issue 2428013002: Setting "SubSystem" option on "Link" page for Visual Studio project. (Closed)
Patch Set: Fixed missed space indent Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/visual_studio_utils_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/visual_studio_writer.cc
diff --git a/tools/gn/visual_studio_writer.cc b/tools/gn/visual_studio_writer.cc
index 0c9972d15f1f5fa708a7867e743219285df10cb3..76c38dca2b02a6b40e67f2e28314ef9353eef639 100644
--- a/tools/gn/visual_studio_writer.cc
+++ b/tools/gn/visual_studio_writer.cc
@@ -153,6 +153,18 @@ void ParseCompilerOptions(const Target* target, CompilerOptions* options) {
}
}
+void ParseLinkerOptions(const std::vector<std::string>& ldflags,
+ LinkerOptions* options) {
+ for (const std::string& flag : ldflags)
+ ParseLinkerOption(flag, options);
+}
+
+void ParseLinkerOptions(const Target* target, LinkerOptions* options) {
+ for (ConfigValuesIterator iter(target); !iter.done(); iter.Next()) {
+ ParseLinkerOptions(iter.cur().ldflags(), options);
+ }
+}
+
// Returns a string piece pointing into the input string identifying the parent
// directory path, excluding the last slash. Note that the input pointer must
// outlive the output.
@@ -539,8 +551,17 @@ bool VisualStudioWriter::WriteProjectFileContents(
cl_compile->SubElement("WarningLevel")->Text(options.warning_level);
}
- // We don't include resource compilation and link options as ninja files
- // are used to generate real build.
+ std::unique_ptr<XmlElementWriter> link =
+ item_definitions->SubElement("Link");
+ {
+ LinkerOptions options;
+ ParseLinkerOptions(target, &options);
+ if (!options.subsystem.empty())
+ link->SubElement("SubSystem")->Text(options.subsystem);
+ }
+
+ // We don't include resource compilation and other link options as ninja
+ // files are used to generate real build.
}
{
« no previous file with comments | « tools/gn/visual_studio_utils_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698