55using System . Linq ;
66using System . Text . RegularExpressions ;
77using CppSharp ;
8- using CppSharp . AST ;
98using CppSharp . Parser ;
109using ClangParser = CppSharp . Parser . ClangParser ;
1110
@@ -168,33 +167,6 @@ static bool QueryQt(QtVersion qt, bool debug)
168167 return true ;
169168 }
170169
171- static IEnumerable < string > ParseDependenciesFromLibtool ( string libFile )
172- {
173- libFile = libFile . Replace ( ".framework" , ".la" ) ;
174- if ( ! File . Exists ( libFile ) )
175- return Enumerable . Empty < string > ( ) ;
176-
177- var text = File . ReadAllText ( libFile ) ;
178-
179- // Get the dependency_libs section from file.
180- // dependency_libs='... -framework Foundation -framework QtCore ...'
181- var libs = Regex . Match ( text , "dependency_libs='(.*)'" ) ;
182-
183- if ( ! libs . Success )
184- throw new Exception (
185- string . Format ( "Error getting dependency libraries from libtool file '{0}'" ,
186- libFile ) ) ;
187-
188- var matches = Regex . Matches ( libs . Groups [ 1 ] . Value , @"-framework\s+(\w+)" ) ;
189- var frameworks = matches . OfType < Match > ( ) . Select ( m => m . Groups [ 1 ] . Value )
190- . Where ( s => s . StartsWith ( "Qt" , StringComparison . Ordinal ) ) ;
191-
192- if ( Platform . IsMacOS )
193- frameworks = frameworks . Select ( framework => framework + ".framework" ) ;
194-
195- return frameworks ;
196- }
197-
198170 static Dictionary < string , IList < string > > GetDependencies ( QtVersion qt )
199171 {
200172 var dependencies = new Dictionary < string , IList < string > > ( ) ;
@@ -220,11 +192,6 @@ static Dictionary<string, IList<string>> GetDependencies(QtVersion qt)
220192 dependencies [ libFile ] = CppSharp . ClangParser . ConvertLibrary ( parserResult . Library ) . Dependencies ;
221193 parserResult . Library . Dispose ( ) ;
222194 }
223- else
224- {
225- var path = Path . Combine ( Platform . IsWindows ? qt . Bins : qt . Libs , libFile ) ;
226- dependencies [ libFile ] = ParseDependenciesFromLibtool ( path ) . ToList ( ) ;
227- }
228195 }
229196 }
230197
0 commit comments