Linux include paths fix

This commit is contained in:
Crawcik
2022-09-07 16:53:30 +02:00
parent 3abbafa530
commit 19d9cd282d
2 changed files with 11 additions and 4 deletions

View File

@@ -58,7 +58,7 @@ namespace Flax.Build.Platforms
if (Compiler != null)
{
// System compiler
ToolchainRoot = string.Empty;
ToolchainRoot = "/";
Log.Verbose($"Using native Linux toolchain (compiler {Compiler})");
HasRequiredSDKsInstalled = true;
}

View File

@@ -23,9 +23,16 @@ namespace Flax.Build.Platforms
: base(platform, architecture, platform.ToolchainRoot, platform.Compiler)
{
// Setup system paths
SystemIncludePaths.Add(Path.Combine(ToolsetRoot, "usr", "include"));
SystemIncludePaths.Add(Path.Combine(ToolsetRoot, "include", "c++", "5.2.0"));
SystemIncludePaths.Add(Path.Combine(ToolsetRoot, "lib", "clang", ClangVersion.Major.ToString(), "include"));
var includePath = Path.Combine(ToolsetRoot, "usr", "include");
SystemIncludePaths.Add(includePath);
var cppIncludePath = Path.Combine(includePath, "c++", ClangVersion.ToString());
if (Directory.Exists(cppIncludePath))
SystemIncludePaths.Add(cppIncludePath);
var clangLibPath = Path.Combine(ToolsetRoot, "usr", "lib", "clang");
var clangIncludePath = Path.Combine(clangLibPath, ClangVersion.Major.ToString(), "include");
if (!Directory.Exists(clangIncludePath))
clangIncludePath = Path.Combine(clangLibPath, ClangVersion.ToString(), "include");
SystemIncludePaths.Add(clangIncludePath);
}
/// <inheritdoc />