Skip to content

Commit 69956ed

Browse files
committed
Deleted the now redundant reading of OS X dependencies through libtool.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
1 parent b4906ce commit 69956ed

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

QtSharp.CLI/Program.cs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Linq;
66
using System.Text.RegularExpressions;
77
using CppSharp;
8-
using CppSharp.AST;
98
using CppSharp.Parser;
109
using 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

Comments
 (0)