Skip to content

Commit

Permalink
Reove use of GetShortPath
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Jan 4, 2019
1 parent db28031 commit 4363ba4
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,6 @@ static string GetNdkToolchainLibraryDir(string binDir)
return libPath;
}

static string GetShortPath (string path)
{
if (Environment.OSVersion.Platform != PlatformID.Win32NT)
return QuoteFileName (path);
var shortPath = KernelEx.GetShortPathName (Path.GetDirectoryName (path));
return Path.Combine (shortPath, Path.GetFileName (path));
}

static string QuoteFileName(string fileName)
{
var builder = new CommandLineBuilder();
Expand Down Expand Up @@ -374,9 +366,9 @@ IEnumerable<Config> GetAotConfigs ()
Diagnostic.Error (5101, ex.Message);
}
var libs = new List<string>() {
GetShortPath (Path.Combine(GetNdkToolchainLibraryDir(toolchainPath), "libgcc.a")),
GetShortPath (Path.Combine(androidLibPath, "libc.so")),
GetShortPath (Path.Combine(androidLibPath, "libm.so"))
Path.Combine(GetNdkToolchainLibraryDir(toolchainPath), "libgcc.a"),
Path.Combine(androidLibPath, "libc.so"),
Path.Combine(androidLibPath, "libm.so")
};
ldFlags = string.Join(";", libs);
}
Expand All @@ -397,17 +389,17 @@ IEnumerable<Config> GetAotConfigs ()
if (!string.IsNullOrEmpty (AotAdditionalArguments))
aotOptions.Add (AotAdditionalArguments);
if (sequencePointsMode == SequencePointsMode.Offline)
aotOptions.Add ("msym-dir=" + GetShortPath (outdir));
aotOptions.Add ("msym-dir=" + QuoteFileName (outdir));
if (AotMode != AotMode.Normal)
aotOptions.Add (AotMode.ToString ().ToLowerInvariant ());

aotOptions.Add ("outfile=" + GetShortPath (outputFile));
aotOptions.Add ("outfile=" + QuoteFileName (outputFile));
aotOptions.Add ("asmwriter");
aotOptions.Add ("mtriple=" + mtriple);
aotOptions.Add ("tool-prefix=" + GetShortPath (toolPrefix));
aotOptions.Add ("tool-prefix=" + QuoteFileName (toolPrefix));
aotOptions.Add ("ld-flags=" + ldFlags);
aotOptions.Add ("llvm-path=" + GetShortPath (sdkBinDirectory));
aotOptions.Add ("temp-path=" + GetShortPath (tempDir));
aotOptions.Add ("llvm-path=" + QuoteFileName (sdkBinDirectory));
aotOptions.Add ("temp-path=" + QuoteFileName (tempDir));

string aotOptionsStr = (EnableLLVM ? "--llvm " : "") + "--aot=" + string.Join (",", aotOptions);

Expand Down

0 comments on commit 4363ba4

Please sign in to comment.