Skip to content

Commit c3eff90

Browse files
committed
Only search for MSVC toolchain in Windows
1 parent e22b8cb commit c3eff90

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Parser/ParserOptions.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.IO;
66
using System.Linq;
77
using System.Reflection;
8+
using System.Runtime.InteropServices;
89
using System.Text.RegularExpressions;
910
using LanguageVersion = CppSharp.Parser.LanguageVersion;
1011

@@ -149,9 +150,12 @@ public void SetupMSVC(VisualStudioVersion vsVersion)
149150

150151
AddSystemIncludeDirs(BuiltinsDir);
151152

152-
vsVersion = MSVCToolchain.FindVSVersion(vsVersion);
153-
foreach (var include in MSVCToolchain.GetSystemIncludes(vsVersion))
154-
AddSystemIncludeDirs(include);
153+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
154+
{
155+
vsVersion = MSVCToolchain.FindVSVersion(vsVersion);
156+
foreach (var include in MSVCToolchain.GetSystemIncludes(vsVersion))
157+
AddSystemIncludeDirs(include);
158+
}
155159
}
156160

157161
// do not remove the CppSharp prefix becase the Mono C# compiler breaks

0 commit comments

Comments
 (0)