Browse Source

Fix GCC path detection for Ubuntu 20.

The path scheme changed in recent Ubuntu versions.

Previously, C++ includes would be found under `/usr/include/c++/9.0`,
but now they are found in `/usr/include/c++/9`.

Change our path detection logic to look for this.

Fixes https://github.com/mono/CppSharp/issues/1392.
pull/1396/head
Joao Matos 5 years ago
parent
commit
af01c86f7b
  1. 3
      src/Parser/ParserOptions.cs

3
src/Parser/ParserOptions.cs

@ -237,7 +237,8 @@ namespace CppSharp.Parser @@ -237,7 +237,8 @@ namespace CppSharp.Parser
AddSystemIncludeDirs(BuiltinsDir);
AddArguments($"-fgnuc-version={longVersion}");
string[] versions = { longVersion, shortVersion };
string majorVersion = shortVersion.Split('.')[0];
string[] versions = { longVersion, shortVersion, majorVersion };
string[] triples = { "x86_64-linux-gnu", "x86_64-pc-linux-gnu" };
if (compiler == "gcc")
{

Loading…
Cancel
Save