Skip to content

Commit

Permalink
Fixed incorrect platform specified for symbol collection
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanL8 committed Feb 20, 2024
1 parent cbd37c9 commit dd9ce84
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Generator/Passes/GenerateSymbolsPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ private int RemainingCompilationTasks
foreach (var module in Context.Options.Modules.Where(compiledLibraries.ContainsKey))
{
CompiledLibrary compiledLibrary = compiledLibraries[module];
CollectSymbols(compiledLibrary.OutputDir, compiledLibrary.Library);
TargetPlatform target = module.Defines.Contains("ANDROID") ? TargetPlatform.Android : Platform.Host;
CollectSymbols(target, compiledLibrary.OutputDir, compiledLibrary.Library);
}
var findSymbolsPass = Context.TranslationUnitPasses.FindPass<FindSymbolsPass>();
findSymbolsPass.Wait = false;
Expand All @@ -378,12 +379,12 @@ private int RemainingCompilationTasks
}
}

private void CollectSymbols(string outputDir, string library)
private void CollectSymbols(TargetPlatform target, string outputDir, string library)
{
using (var linkerOptions = new LinkerOptions(Context.LinkerOptions))
{
linkerOptions.AddLibraryDirs(outputDir);
var output = GetOutputFile(TargetPlatform.Android, library);
var output = GetOutputFile(target, library);
linkerOptions.AddLibraries(output);
using (var parserResult = Parser.ClangParser.ParseLibrary(linkerOptions))
{
Expand Down

0 comments on commit dd9ce84

Please sign in to comment.