static string _Find()
{
var compiler = Environment.GetEnvironmentVariable("CCLASH_CL");
if ((compiler != null) && File.Exists(compiler)) return compiler;
var self = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
var path = Environment.GetEnvironmentVariable("PATH");
var paths = path.Split(';');
var selfdir = Path.GetDirectoryName(self);
var realcl = Path.Combine(selfdir, "cl_real.exe");
if (File.Exists(realcl)) return realcl;
foreach (var p in paths)
{
var f = Path.Combine(p, "cl.exe");
if (FileUtils.Exists(f))
{
if (f.Equals(self, StringComparison.CurrentCultureIgnoreCase))
{
continue;
}
if (Path.IsPathRooted(f))
{
return f;
}
}
}
return null;
}