Add TargetCompiler to Flax.Build toolchains

This commit is contained in:
Wojtek Figat
2023-01-09 17:59:11 +01:00
parent 0595f38fe4
commit 17f9219cd0
4 changed files with 29 additions and 2 deletions

View File

@@ -245,7 +245,7 @@ namespace Flax.Build.Bindings
public static void GenerateCppVirtualWrapperCallBaseMethod(BuildData buildData, StringBuilder contents, VirtualClassInfo classInfo, FunctionInfo functionInfo, string scriptVTableBase, string scriptVTableOffset)
{
contents.AppendLine(" // Prevent stack overflow by calling native base method");
if (buildData.Toolchain is Platforms.UnixToolchain)
if (buildData.Toolchain.Compiler == TargetCompiler.Clang)
{
// Clang compiler
// TODO: secure VTableFunctionInjector with mutex (even at cost of performance)
@@ -1448,7 +1448,7 @@ namespace Flax.Build.Bindings
}
var t = functionInfo.IsConst ? " const" : string.Empty;
contents.AppendLine($" typedef {functionInfo.ReturnType} ({classInfo.NativeName}::*{functionInfo.UniqueName}_Signature)({thunkParams}){t};");
if (!(buildData.Toolchain is Platforms.UnixToolchain))
if (buildData.Toolchain.Compiler != TargetCompiler.Clang)
{
// MSVC or other compiler
contents.AppendLine($" typedef {functionInfo.ReturnType} ({classInfo.NativeName}Internal::*{functionInfo.UniqueName}_Internal_Signature)({thunkParams}){t};");