Fix building consoles
This commit is contained in:
@@ -13,12 +13,12 @@ namespace Flax.Build.NativeCpp
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class IncludesCache
|
public static class IncludesCache
|
||||||
{
|
{
|
||||||
private static Dictionary<string, string[]> DirectIncludesCache = new Dictionary<string, string[]>();
|
private static Dictionary<string, string[]> DirectIncludesCache = new();
|
||||||
private static Dictionary<string, string[]> AllIncludesCache = new Dictionary<string, string[]>();
|
private static Dictionary<string, string[]> AllIncludesCache = new();
|
||||||
private static Dictionary<string, DateTime> DirectIncludesTimestampCache = new Dictionary<string, DateTime>();
|
private static Dictionary<string, DateTime> DirectIncludesTimestampCache = new();
|
||||||
private static Dictionary<string, DateTime> AllIncludesTimestampCache = new Dictionary<string, DateTime>();
|
private static Dictionary<string, DateTime> AllIncludesTimestampCache = new();
|
||||||
private static Dictionary<string, bool> FileExistsCache = new Dictionary<string, bool>();
|
private static Dictionary<string, bool> FileExistsCache = new();
|
||||||
private static Dictionary<string, DateTime> FileTimestampCache = new Dictionary<string, DateTime>();
|
private static Dictionary<string, DateTime> FileTimestampCache = new();
|
||||||
private static readonly string IncludeToken = "include";
|
private static readonly string IncludeToken = "include";
|
||||||
private static string CachePath;
|
private static string CachePath;
|
||||||
|
|
||||||
@@ -231,6 +231,8 @@ namespace Flax.Build.NativeCpp
|
|||||||
|
|
||||||
private static string[] GetDirectIncludes(string sourceFile)
|
private static string[] GetDirectIncludes(string sourceFile)
|
||||||
{
|
{
|
||||||
|
if (!FileExists(sourceFile))
|
||||||
|
return Array.Empty<string>();
|
||||||
DateTime? lastModified = null;
|
DateTime? lastModified = null;
|
||||||
|
|
||||||
// Try hit the cache
|
// Try hit the cache
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||||
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
|
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
|
||||||
|
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
|
||||||
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<DefineConstants>USE_NETCORE</DefineConstants>
|
<DefineConstants>USE_NETCORE</DefineConstants>
|
||||||
@@ -24,6 +25,13 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Properties" />
|
<Folder Include="Properties" />
|
||||||
|
<Compile Include="**\*.cs" />
|
||||||
|
<Compile Remove="obj\**" />
|
||||||
|
<Compile Include="..\..\Platforms\XboxOne\Flax.Build\*.cs" />
|
||||||
|
<Compile Include="..\..\Platforms\XboxScarlett\Flax.Build\*.cs" />
|
||||||
|
<Compile Include="..\..\Platforms\Switch\Flax.Build\*.cs" />
|
||||||
|
<Compile Include="..\..\Platforms\PS4\Flax.Build\*.cs" />
|
||||||
|
<Compile Include="..\..\Platforms\PS5\Flax.Build\*.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace Flax.Build.Platforms
|
|||||||
ClangPath = Path.Combine(ToolchainPath, "usr/bin/clang++");
|
ClangPath = Path.Combine(ToolchainPath, "usr/bin/clang++");
|
||||||
LinkerPath = Path.Combine(ToolchainPath, "usr/bin/clang++");
|
LinkerPath = Path.Combine(ToolchainPath, "usr/bin/clang++");
|
||||||
ArchiverPath = Path.Combine(ToolchainPath, "usr/bin/libtool");
|
ArchiverPath = Path.Combine(ToolchainPath, "usr/bin/libtool");
|
||||||
ClangVersion = GetClangVersion(ClangPath);
|
ClangVersion = GetClangVersion(platform.Target, ClangPath);
|
||||||
SdkPath = Path.Combine(SdkPath, "SDKs");
|
SdkPath = Path.Combine(SdkPath, "SDKs");
|
||||||
var sdks = Directory.GetDirectories(SdkPath);
|
var sdks = Directory.GetDirectories(SdkPath);
|
||||||
var sdkPrefix = "MacOSX";
|
var sdkPrefix = "MacOSX";
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ namespace Flax.Build.Platforms
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determinate compiler version
|
// Determinate compiler version
|
||||||
ClangVersion = GetClangVersion(ClangPath);
|
ClangVersion = GetClangVersion(platform.Target, ClangPath);
|
||||||
LibStdCppVersion = GetLibStdCppVersion(ClangPath) ?? ClangVersion.ToString();
|
LibStdCppVersion = GetLibStdCppVersion(ClangPath) ?? ClangVersion.ToString();
|
||||||
|
|
||||||
// Check version
|
// Check version
|
||||||
@@ -156,13 +156,16 @@ namespace Flax.Build.Platforms
|
|||||||
return libName;
|
return libName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Version GetClangVersion(string path)
|
public static Version GetClangVersion(TargetPlatform platform, string path)
|
||||||
{
|
{
|
||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
throw new Exception(string.Format("Missing Clang ({0})", path));
|
throw new Exception(string.Format("Missing Clang ({0})", path));
|
||||||
|
|
||||||
// Parse the version
|
// Parse the version
|
||||||
string output = Utilities.ReadProcessOutput(path, "--version -dumpversion");
|
string arg = "--version -dumpversion";
|
||||||
|
if (platform == TargetPlatform.PS4)
|
||||||
|
arg = "--version";
|
||||||
|
string output = Utilities.ReadProcessOutput(path, arg);
|
||||||
Regex versionPattern = new Regex("\\d+(\\.\\d+)+");
|
Regex versionPattern = new Regex("\\d+(\\.\\d+)+");
|
||||||
Match versionMatch = versionPattern.Match(output);
|
Match versionMatch = versionPattern.Match(output);
|
||||||
if (versionMatch.Success)
|
if (versionMatch.Success)
|
||||||
|
|||||||
Reference in New Issue
Block a user