Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jit-format for Windows #303

Merged
merged 1 commit into from
Nov 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/jit-format/jit-format.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void SetPlatform()
{
if (match.Groups[1].Value.Trim() == "Windows")
{
_os = "Windows_NT";
_os = "Windows";
}
else if (match.Groups[1].Value.Trim() == "Darwin")
{
Expand Down Expand Up @@ -158,11 +158,6 @@ private void validate()
}
}

if (_os == "Windows")
{
_os = "Windows_NT";
}

if (_srcDirectory == null)
{
if (_verbose)
Expand Down Expand Up @@ -212,12 +207,12 @@ private void validate()
}

// Check that we can find compile_commands.json on windows
if (_os == "Windows_NT")
if (_os.ToLower() == "windows")
{
// If the user didn't specify a compile_commands.json, we need to see if one exists, and if not, create it.
if (!_untidy && _compileCommands == null)
{
string[] compileCommandsPath = { _rootPath, "..", "..", "artifacts", "nmakeobj", "Windows_NT." + _arch + "." + _build, "compile_commands.json" };
string[] compileCommandsPath = { _rootPath, "..", "..", "artifacts", "nmakeobj", _os + "." + _arch + "." + _build, "compile_commands.json" };
_compileCommands = Path.Combine(compileCommandsPath);
_rewriteCompileCommands = true;

Expand Down Expand Up @@ -368,7 +363,7 @@ public T ExtractDefault<T>(string name, out bool found)
return default(T);
}

public bool IsWindows { get { return (_os == "Windows_NT"); } }
public bool IsWindows { get { return (_os.ToLower() == "windows"); } }
public bool DoVerboseOutput { get { return _verbose; } }
public bool DoClangTidy { get { return !_untidy; } }
public bool DoClangFormat { get { return !_noformat; } }
Expand Down