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..6dde2555bf0e8bb6f75efd03faf4397ef8631437 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 = SDKUtilities.GetSDKVersion(root, out revision); |
+ if (version > SDKUtilities.MinPNaCLSDKVersion) |
+ return true; |
+ if (version == SDKUtilities.MinPNaCLSDKVersion && revision >= SDKUtilities.MinPNaCLSDKRevision) |
noelallen1
2012/12/08 00:50:23
wrap
|
+ return true; |
+ return false; |
+ } |
} |
} |