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

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

Issue 11360111: [NaCl Addin] Fix building of libraries in MSVS (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 1 month 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
Index: visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/NaClCompile.cs
diff --git a/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/NaClCompile.cs b/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/NaClCompile.cs
index ac3701b9df18fa00d938f3ece9ba2acc11a6262a..2bc833123e643fcfc8df6e074519f389b86dc905 100644
--- a/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/NaClCompile.cs
+++ b/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/NaClCompile.cs
@@ -1,4 +1,6 @@
-
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
using System;
using System.Collections.Generic;
using System.Text;
@@ -36,6 +38,9 @@ namespace NaCl.Build.CPPTasks
public bool MultiProcessorCompilation { get; set; }
+ [Required]
+ public string ConfigurationType { get; set; }
+
[Obsolete]
protected override StringDictionary EnvironmentOverride
{
@@ -228,6 +233,11 @@ namespace NaCl.Build.CPPTasks
if (sourceFile != null)
{
+ //build command line from components and add required switches
+ string props = xamlParser.Parse(sourceFile, fullOutputName);
+ commandLine.Append(props);
+ commandLine.Append(" -c ");
+
// Remove rtti items as they are not relevant in C compilation and will produce warnings
binji 2012/11/08 19:13:06 nit: wrap at 100
if (SourceIsC(sourceFile.ToString()))
{
@@ -235,10 +245,10 @@ namespace NaCl.Build.CPPTasks
commandLine.Replace("-frtti", "");
}
- //build command line from components and add required switches
- string props = xamlParser.Parse(sourceFile, fullOutputName);
- commandLine.Append(props);
- commandLine.Append(" -c ");
+ if (ConfigurationType == "DynamicLibrary")
+ {
+ commandLine.Append(" -fPIC ");
+ }
}
return commandLine.ToString();
@@ -316,7 +326,7 @@ namespace NaCl.Build.CPPTasks
try
{
string commandLine = GenerateCommandLineFromProps(sourceItem, true);
- commandLine += "\"" + GCCUtilities.ConvertPathWindowsToPosix(sourceItem.ToString()) + "\"";
+ commandLine += GCCUtilities.ConvertPathWindowsToPosix(sourceItem.ToString());
if (OutputCommandLine)
{
@@ -377,8 +387,7 @@ namespace NaCl.Build.CPPTasks
foreach (ITaskItem sourceItem in sources)
{
- string src = GCCUtilities.ConvertPathWindowsToPosix(sourceItem.ToString());
- cmd += " \"" + src + "\"";
+ cmd += GCCUtilities.ConvertPathWindowsToPosix(sourceItem.ToString());
}
try

Powered by Google App Engine
This is Rietveld 408576698