Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Commit

Permalink
Removed dead code in SharpGen.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoritzinsky committed Mar 17, 2017
1 parent e9d2992 commit 5849f41
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 70 deletions.
4 changes: 0 additions & 4 deletions Source/Mapping.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
-->
<config id="sharpdx-root" xmlns="urn:SharpGen.Config">

<!--<include-dir override="true">$(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides\shared</include-dir>
<include-dir override="true">$(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides\um</include-dir>
<include-dir override="true">$(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides</include-dir>
<include-dir>=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\Setup\VC\ProductDir;Include</include-dir>-->
<include-dir override="true">$(THIS_CONFIG_PATH)\..\External\LegacyHeaders</include-dir>
<include-dir>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include</include-dir>
<include-dir>=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10;Include\10.0.14393.0\shared</include-dir>
Expand Down
66 changes: 0 additions & 66 deletions Source/Tools/SharpGen/Parser/GccXml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ public void Preprocess(string headerFile, DataReceivedEventHandler handler)
{
Logger.RunInContext("gccxml", () =>
{
//string vsVersion = GetVisualStudioVersion();
if (!File.Exists(ExecutablePath))
Logger.Fatal("gccxml.exe not found from path: [{0}]", ExecutablePath);
Expand Down Expand Up @@ -272,67 +270,6 @@ private List<string> GetIncludePaths()
return paths;
}

private static bool CheckVisualStudioVersion(string vsVersion)
{
var key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
var subKey = key.OpenSubKey(@"SOFTWARE\Microsoft\VisualStudio\" + vsVersion + @".0\Setup\VC");
return subKey != null;
}

public static string ResolveVisualStudioVersion(params string[] versions)
{
foreach (var version in versions)
{
if (CheckVisualStudioVersion(version))
return version;
}
Logger.Exit("Visual Studio [{0}] with C++ not found. SharpDX requires this version to generate code from C++", string.Join("/", versions));
return null;
}

public static string GetVisualStudioVersion()
{
string vsVersion = ResolveVisualStudioVersion("12");
return vsVersion;
}

public static string GetWindowsFramework7Version(params string[] versions)
{
var key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
foreach (var version in versions)
{
var subKey = key.OpenSubKey(@"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v" + version);
if (subKey != null)
{
// Check that the include directory actually exist
object directory = subKey.GetValue("InstallationFolder");
if (directory != null)
{
var includeDirectory = Path.Combine(directory.ToString(), "include");
if(Directory.Exists(includeDirectory))
{
// Check that we have enough files in the directory (case where the directory is there but
// completely empty)
if(Directory.EnumerateFiles(includeDirectory, "*.*", SearchOption.TopDirectoryOnly).Count() > 70)
{
return version;
}
else
{
Logger.Error("VS{0} Include directory from [{0}] is missing SDK C++ include files. Check your install",
version,
includeDirectory);
}
}
}

}
}

Logger.Exit("Missing Windows SDK [{0}]. Please, download and install the SDK from Microsoft website (Check for a full install that includes Framework headers and C++ compiler).", string.Join("/", versions));
return null;
}

/// <summary>
/// Processes the specified header headerFile.
/// </summary>
Expand All @@ -344,9 +281,6 @@ public StreamReader Process(string headerFile)

Logger.RunInContext("gccxml", () =>
{
//string vsVersion = GetVisualStudioVersion();
ExecutablePath = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, ExecutablePath));
if (!File.Exists(ExecutablePath)) Logger.Fatal("gccxml.exe not found from path: [{0}]", ExecutablePath);
Expand Down

0 comments on commit 5849f41

Please sign in to comment.