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

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

Issue 11266051: Add PNaCl support for VS addin. (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: fix nits and tests 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
Index: visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/GCCUtilities.cs
diff --git a/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/GCCUtilities.cs b/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/GCCUtilities.cs
index be3a5ef568d0a1e40604b20be1feb475ee43ff3a..fa8357b040d423afc651d20bd2fc3a149b0c9752 100644
--- a/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/GCCUtilities.cs
+++ b/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/GCCUtilities.cs
@@ -12,6 +12,30 @@ namespace NaCl.Build.CPPTasks
{
public const int s_CommandLineLength = 256;
+ /// <summary>
+ /// Find python executable in user's PATH.
+ /// </summary>
+ public static bool FindPython()
+ {
+ string envvar = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Process);
+ List<string> pathList = new List<string>(envvar.Split(';'));
+ foreach (string path in pathList)
+ {
+ string testPath = Path.Combine(path, "python.bat");
+ if (File.Exists(testPath))
+ {
+ return true;
+ }
+ testPath = Path.Combine(path, "python.exe");
+ if (File.Exists(testPath))
+ {
+ return true;
+
+ }
+ }
+ return false;
+ }
+
public static string ConvertPathWindowsToPosix(string path)
{
return path.Replace('\\', '/');

Powered by Google App Engine
This is Rietveld 408576698