Skip to content

Commit 6f784b7

Browse files
committed
Fix the expression-generator after changed paths
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 3d750e3 commit 6f784b7

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

src/CppParser/Bootstrap/Bootstrap.cs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace CppSharp
1818
/// </summary>
1919
class Bootstrap : ILibrary
2020
{
21-
static string GetSourceDirectory(string dir)
21+
private static string GetSourceDirectory(string dir)
2222
{
2323
var directory = Directory.GetParent(Directory.GetCurrentDirectory());
2424

@@ -35,22 +35,15 @@ static string GetSourceDirectory(string dir)
3535
throw new Exception("Could not find build directory: " + dir);
3636
}
3737

38-
static string GetLLVMRevision()
39-
{
40-
var buildDir = GetSourceDirectory("build");
41-
return File.ReadAllText(Path.Combine(buildDir, "LLVM-commit"));
42-
}
38+
private static string GetLLVMRevision(string llvmDir)
39+
=> File.ReadAllText(Path.Combine(llvmDir, "LLVM-commit"));
4340

44-
static string GetLLVMBuildDirectory()
41+
private static string GetLLVMBuildDirectory()
4542
{
46-
var llvmRevision = GetLLVMRevision().Substring(0, 6);
47-
48-
var scriptsDir = Path.Combine(GetSourceDirectory("build"), "scripts");
49-
var entries = Directory.EnumerateDirectories(scriptsDir);
50-
51-
var llvmPath = entries.FirstOrDefault(entry => entry.Contains(llvmRevision));
43+
var llvmDir = Path.Combine(GetSourceDirectory("build"), "llvm");
44+
var llvmRevision = GetLLVMRevision(llvmDir).Substring(0, 6);
5245

53-
return llvmPath;
46+
return Directory.EnumerateDirectories(llvmDir, $"*{llvmRevision}*").FirstOrDefault();
5447
}
5548

5649
public void Setup(Driver driver)
@@ -75,8 +68,8 @@ public void Setup(Driver driver)
7568
{
7669
Path.Combine(llvmPath, "include"),
7770
Path.Combine(llvmPath, "build", "include"),
78-
Path.Combine(llvmPath, "build", "tools", "clang", "include"),
79-
Path.Combine(llvmPath, "tools", "clang", "include")
71+
Path.Combine(llvmPath, "build", "clang", "include"),
72+
Path.Combine(llvmPath, "clang", "include")
8073
});
8174

8275
module.Headers.AddRange(new[]

0 commit comments

Comments
 (0)