Chromium Code Reviews| 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 cb4da6604103f6a73e09cb5aa98298bcb7dafb47..b213eb9cc7f9843689353d6ac7cfc38c04624c63 100644 |
| --- a/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/NaClCompile.cs |
| +++ b/visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/NaClCompile.cs |
| @@ -263,11 +263,27 @@ namespace NaCl.Build.CPPTasks |
| { |
| if (Platform.Equals("pnacl", StringComparison.OrdinalIgnoreCase)) |
| { |
| - if (!GCCUtilities.FindPython()) |
| + if (!SDKUtilities.FindPython()) |
| { |
| Log.LogError("PNaCl compilation requires python in your executable path."); |
| return -1; |
| } |
| + |
| + // The SDK root is five levels up from the compiler binary. |
| + string sdkroot = Path.GetDirectoryName(Path.GetDirectoryName(pathToTool)); |
| + sdkroot = Path.GetDirectoryName(Path.GetDirectoryName(sdkroot)); |
| + sdkroot = Path.GetDirectoryName(sdkroot); |
| + |
| + int revision; |
| + int version = SDKUtilities.GetSDKVersion(sdkroot, out revision); |
| + if (revision < SDKUtilities.MinPNaCLSDKVersion) |
| + { |
| + Log.LogError("The configured version of the NaCl SDK ({0} r{1}) is too old " + |
| + "for building PNaCl projects.\n" + |
| + "Please install at least 24 r{2} using the naclsdk command " + |
| + "line tool.", version, revision, SDKUtilities.MinPNaCLSDKVersion); |
| + return -1; |
| + } |
| } |
| // If multiprocess complication is enabled (not the VS default) |
|
binji
2012/10/31 06:36:22
sp: compilation
|
| @@ -276,7 +292,7 @@ namespace NaCl.Build.CPPTasks |
| // gcc |
| if (MultiProcessorCompilation && ProcessorNumber != 1) |
| { |
| - if (!GCCUtilities.FindPython()) |
| + if (!SDKUtilities.FindPython()) |
| { |
| MessageBox.Show("Multi-processor Compilation with NaCl requires that python " + |
|
binji
2012/10/31 06:36:22
maybe this should be Log.LogError like above?
|
| "be available in the visual studio executable path.\n" + |