Skip to content

Commit 9244160

Browse files
authored
ParserGen: Support generating bindings on Linux/macOS (#1959)
The previous approach (using backslashes for path separators) only works on Windows.
1 parent cb60f3b commit 9244160

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/CppParser/ParserGen/ParserGen.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void ApplyBootstrapPatch()
5555
Console.WriteLine("Applying bootstrap patch...");
5656

5757
foreach (var filePath in Directory.EnumerateFiles(BootstrapPatchPath,
58-
"*",
58+
"*",
5959
new EnumerationOptions
6060
{
6161
RecurseSubdirectories = true,
@@ -134,7 +134,7 @@ private void SetupLinuxOptions(ParserOptions options)
134134
bool isArm = Triple.Contains("arm");
135135

136136
var headersPath = Platform.IsLinux ? string.Empty :
137-
Path.Combine(GetSourceDirectory("build"), "headers",
137+
Path.Combine(GetSourceDirectory("build"), "headers",
138138
isArm ? "arm64-linux-gnu" : "x86_64-linux-gnu");
139139
options.SetupLinux(headersPath);
140140
options.AddDefines("_GLIBCXX_USE_CXX11_ABI=" + (IsGnuCpp11Abi ? "1" : "0"));
@@ -221,7 +221,7 @@ public static void Main(string[] args)
221221
Console.WriteLine();
222222
}
223223

224-
var osxHeadersPath = Path.Combine(GetSourceDirectory("build"), @"headers\osx");
224+
var osxHeadersPath = Path.Combine(GetSourceDirectory("build"), "headers", "osx");
225225
if (Directory.Exists(osxHeadersPath) || Platform.IsMacOS)
226226
{
227227
Console.WriteLine("Generating the C# parser bindings for OSX x86...");
@@ -237,7 +237,7 @@ public static void Main(string[] args)
237237
Console.WriteLine();
238238
}
239239

240-
var linuxHeadersPath = Path.Combine(GetSourceDirectory("build"), @"headers\x86_64-linux-gnu");
240+
var linuxHeadersPath = Path.Combine(GetSourceDirectory("build"), "headers", "x86_64-linux-gnu");
241241
if (Directory.Exists(linuxHeadersPath) || Platform.IsLinux)
242242
{
243243
Console.WriteLine("Generating the C# parser bindings for Linux...");

0 commit comments

Comments
 (0)