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

Unified Diff: visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/XamlParser.cs

Issue 11044024: Implement multi-core builds in MSVS (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 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 | « visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/NaClLink.cs ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/XamlParser.cs
diff --git a/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/XamlParser.cs b/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/XamlParser.cs
index 776fa8b1694bb8b009ad4132d63a83aa61c8e113..958ad71922217a0c79cb2e669cfa2f8d7a1361d0 100644
--- a/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/XamlParser.cs
+++ b/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/XamlParser.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.IO;
using Microsoft.Build.Framework;
using System.Xaml;
@@ -39,19 +40,27 @@ namespace NaCl.Build.CPPTasks
{
{ typeof(StringListProperty), GenerateArgumentStringList },
{ typeof(StringProperty), GenerateArgumentString },
- { typeof(IntProperty), GenerateArgumentString },
+ { typeof(IntProperty), GenerateArgumentInt },
{ typeof(BoolProperty), GenerateArgumentBool },
{ typeof(EnumProperty), GenerateArgumentEnum }
};
}
- public string Parse(ITaskItem taskItem)
+ public string Parse(ITaskItem taskItem, bool fullOutputName)
{
CommandLineBuilder builder = new CommandLineBuilder();
foreach (string name in taskItem.MetadataNames)
{
string value = taskItem.GetMetadata(name);
+ if (fullOutputName && name == "ObjectFileName")
+ {
+ if ((File.GetAttributes(value) & FileAttributes.Directory) != 0)
+ {
+ value = Path.Combine(value, Path.GetFileName(taskItem.ItemSpec));
+ value = Path.ChangeExtension(value, ".obj");
+ }
+ }
AppendArgumentForProperty(builder, name, value);
}
@@ -86,7 +95,7 @@ namespace NaCl.Build.CPPTasks
{
value = value.Trim();
- // could cache this SubType test off in property wrapper or somewhere if performance were an issue
+ // could cache this SubType test off in property wrapper or somewhere if performance were an issue
string switchName = m_parsedBuildRule.SwitchPrefix + property.Switch;
switchName += property.Separator;
if (subtype == "file" || subtype == "folder")
@@ -126,6 +135,12 @@ namespace NaCl.Build.CPPTasks
AppendStringValue(builder, property, casted.Subtype, value);
}
+ private void GenerateArgumentInt(CommandLineBuilder builder, BaseProperty property, string value)
+ {
+ // Currently we only have one Int property and it doesn't correspond to a
+ // command line arguemnt (ProcessorNumber) so we ignore it here.
+ }
+
private void GenerateArgumentBool(CommandLineBuilder builder, BaseProperty property, string value)
{
if (value == "true")
« no previous file with comments | « visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/NaClLink.cs ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698