Skip to content

Commit f7cfa6f

Browse files
committed
Fix path combine and improve error reporting for ParserGen.
1 parent 06eda44 commit f7cfa6f

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/CppParser/ParserGen/ParserGen.cs

+17-5
Original file line numberDiff line numberDiff line change
@@ -166,24 +166,32 @@ public static void Main(string[] args)
166166
ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "x86_64-pc-win32-msvc"));
167167
Console.WriteLine();
168168
}
169+
else
170+
{
171+
Console.WriteLine("Skipping generation for Windows due to missing headers, only supported on Windows platform.");
172+
}
169173

170-
var osxHeadersPath = Path.Combine(GetSourceDirectory("build"), @"headers\osx");
174+
var osxHeadersPath = Path.Combine(GetSourceDirectory("build"), @"headers", "osx");
171175
if (Directory.Exists(osxHeadersPath) || Platform.IsMacOS)
172176
{
173-
Console.WriteLine("Generating the C# parser bindings for OSX x86...");
177+
Console.WriteLine("Generating the C# parser bindings for macOS x86...");
174178
ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "i686-apple-darwin12.4.0"));
175179
Console.WriteLine();
176180

177-
Console.WriteLine("Generating the C# parser bindings for OSX x64...");
181+
Console.WriteLine("Generating the C# parser bindings for macOS x64...");
178182
ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "x86_64-apple-darwin12.4.0"));
179183
Console.WriteLine();
180184

181-
Console.WriteLine("Generating the C# parser bindings for OSX ARM64...");
185+
Console.WriteLine("Generating the C# parser bindings for macOS ARM64...");
182186
ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "arm64-apple-darwin12.4.0"));
183187
Console.WriteLine();
184188
}
189+
else
190+
{
191+
Console.WriteLine("Skipping generation for macOS due to missing headers.");
192+
}
185193

186-
var linuxHeadersPath = Path.Combine(GetSourceDirectory("build"), @"headers\x86_64-linux-gnu");
194+
var linuxHeadersPath = Path.Combine(GetSourceDirectory("build"), @"headers", "x86_64-linux-gnu");
187195
if (Directory.Exists(linuxHeadersPath) || Platform.IsLinux)
188196
{
189197
Console.WriteLine("Generating the C# parser bindings for Linux...");
@@ -204,6 +212,10 @@ public static void Main(string[] args)
204212
isGnuCpp11Abi: true));
205213
Console.WriteLine();
206214
}
215+
else
216+
{
217+
Console.WriteLine("Skipping generation for Linux due to missing headers.");
218+
}
207219
}
208220
}
209221
}

0 commit comments

Comments
 (0)