/// <summary> /// Get's protoc directory based on <paramref name="target"/>. /// </summary> /// <param name="target">The target.</param> /// <returns>Returns last directory part for given OS.</returns> public static string DirectoryFromTarget(OSTarget target) { switch (target) { case OSTarget.Google: return("google"); case OSTarget.Linux64: return("linux_x64"); case OSTarget.Linux86: return("linux_x86"); case OSTarget.MacOSX64: return("macosx_x64"); case OSTarget.MacOSX86: return("macosx_x86"); case OSTarget.Windows64: return("windows_x64"); case OSTarget.Windows86: return("windows_x86"); default: throw new Exception($"Unknown OSTarget {target}"); } }
/// <summary> /// Checks if target is Windows. /// </summary> /// <param name="target">The target.</param> /// <returns>True when target is Windows, false otherwise.</returns> public static bool IsWindows(OSTarget target) => target == OSTarget.Windows64 || target == OSTarget.Windows86;