Exemplo n.º 1
0
        public bool ParseLibraries()
        {
            ClangParser.LibraryParsed += OnFileParsed;
            foreach (Module module in Options.Modules)
            {
                using var linkerOptions = new LinkerOptions(Context.LinkerOptions);
                foreach (string libraryDir in module.LibraryDirs)
                {
                    linkerOptions.AddLibraryDirs(libraryDir);
                }

                foreach (string library in module.Libraries)
                {
                    if (!Context.Symbols.Libraries.Any(( NativeLibrary l ) => l.FileName == library))
                    {
                        linkerOptions.AddLibraries(library);
                    }
                }

                using ParserResult parserResult = ClangParser.ParseLibrary(linkerOptions);
                if (parserResult.Kind == ParserResultKind.Success)
                {
                    for (uint num = 0u; num < parserResult.LibrariesCount; num++)
                    {
                        Context.Symbols.Libraries.Add(ClangParser.ConvertLibrary(parserResult.GetLibraries(num)));
                    }
                }
            }

            ClangParser.LibraryParsed -= OnFileParsed;
            Context.Symbols.IndexSymbols();
            SortModulesByDependencies();
            return(true);
        }