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

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

Issue 11475048: [NaCl SDK Addin] Fix detection of PNaCl toolchain. (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: fix long long Created 8 years 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/SDKUtilities.cs
diff --git a/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/SDKUtilities.cs b/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/SDKUtilities.cs
index 6d2d2e6095acdc0aef5ef168f6294f9af7cb2ff5..e59ca1a3f836214ecb490a7d4ad25cfd4d03db89 100644
--- a/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/SDKUtilities.cs
+++ b/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/SDKUtilities.cs
@@ -14,7 +14,8 @@ namespace NaCl.Build.CPPTasks
public class SDKUtilities
{
// The first version of pepper with a known working PNaCl toolchain
- public const int MinPNaCLSDKVersion = 166868;
+ public const int MinPNaCLSDKVersion = 24;
+ public const int MinPNaCLSDKRevision = 166868;
/// <summary>
/// Find python executable in user's PATH.
@@ -41,8 +42,7 @@ namespace NaCl.Build.CPPTasks
}
/// <summary>
- /// Retrieve the version and revsion of the current NaCl SDK located
- /// at $NACL_SDK_ROOT.
+ /// Retrieve the version and revsion of the given NaCl SDK root.
/// </summary>
public static int GetSDKVersion(string root, out int revision)
{
@@ -59,5 +59,20 @@ namespace NaCl.Build.CPPTasks
}
return version;
}
+
+ /// <summary>
+ /// Retrun true if the NaCl SDK at the given location supports
+ /// the PNaCl toolchain.
+ /// </summary>
+ public static bool SupportsPNaCl(string root)
+ {
+ int revision;
+ int version = GetSDKVersion(root, out revision);
+ if (version > MinPNaCLSDKVersion)
+ return true;
+ if (version == MinPNaCLSDKVersion && revision >= MinPNaCLSDKRevision)
+ return true;
+ return false;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698