Beispiel #1
0
 public static DotNetAssembly SetupInvocation(
     DotNetAssembly inputAssembly,
     DotsRuntimeCSharpProgramConfiguration dotsConfig)
 {
     return(inputAssembly.ApplyDotNetAssembliesPostProcessor($"artifacts/{inputAssembly.Path.FileNameWithoutExtension}/{dotsConfig.Identifier}/post_typereg/",
                                                             (inputAssemblies, targetDirectory) => AddActions(dotsConfig, inputAssemblies, targetDirectory)));
 }
 public static DotNetAssembly SetupInvocation(
     DotNetAssembly inputAssembly,
     CSharpProgramConfiguration config,
     string[] defines)
 {
     return(inputAssembly.ApplyDotNetAssembliesPostProcessor($"artifacts/{inputAssembly.Path.FileNameWithoutExtension}/{config.Identifier}/post_ilprocessing/",
                                                             (inputAssemblies, targetDirectory) => AddActions(config, inputAssemblies, targetDirectory, defines)
                                                             ));
 }
Beispiel #3
0
 public static DotNetAssembly SetupInvocation(DotNetAssembly inputGame, NPath outputPath, NativeProgramConfiguration config)
 {
     return(inputGame.ApplyDotNetAssembliesPostProcessor(outputPath, (inputAssemblies, targetDir) => AddActions(inputAssemblies, targetDir, config)
                                                         ));
 }
Beispiel #4
0
    public static BagOfObjectFilesLibrary SetupBurstCompilationForAssemblies(
        BurstCompiler compiler,
        DotNetAssembly unpatchedInputAssembly,
        NPath outputDirForObjectFile,
        NPath outputDirForPatchedAssemblies,
        string pinvokeName,
        out DotNetAssembly patchedAssembly)
    {
        var objectFile = outputDirForObjectFile.Combine("lib_burst_generated_part_0" + compiler.ObjectFileExtension);

        patchedAssembly = unpatchedInputAssembly.ApplyDotNetAssembliesPostProcessor(
            outputDirForPatchedAssemblies,
            (inputAssemblies, targetDir) =>
        {
            var inputPaths = inputAssemblies.SelectMany(asm =>
            {
                var ret = new List <NPath> {
                    asm.Path
                };
                if (asm.DebugSymbolPath != null)
                {
                    ret.Add(asm.DebugSymbolPath);
                }
                return(ret);
            });
            var commandLineArguments = new[]
            {
                $"--platform={compiler.TargetPlatform}",
                $"--backend=burst-llvm",
                $"--target={compiler.TargetArchitecture}",
                $"--format={compiler.ObjectFormat}",
                compiler.SafetyChecks ? "--safety-checks" : "",
                $"--dump=\"None\"",
                compiler.DisableVectors ? "--disable-vectors" : "",
                compiler.Link ? "" : "--nolink",
                $"--float-precision={compiler.FloatPrecision}",
                $"--keep-intermediate-files",
                "--verbose",
                $"--patch-assemblies-into={outputDirForPatchedAssemblies}",
                $"--output={objectFile.Parent.Combine(pinvokeName)}",
                $"--only-static-methods",
                "--method-prefix=burstedmethod_",
                $"--pinvoke-name={pinvokeName}"
            }.Concat(inputAssemblies.Select(asm => $"--root-assembly={asm.Path}"));
            if (!compiler.UseOwnToolchain)
            {
                commandLineArguments = commandLineArguments.Concat(new[] { "--no-native-toolchain" });
            }

            var executableStringFor = HostPlatform.IsWindows ? BurstExecutable.ToString(SlashMode.Native) : "mono";
            if (!HostPlatform.IsWindows)
            {
                commandLineArguments = new[] { BurstExecutable.ToString(SlashMode.Native) }
            }
            .Concat(commandLineArguments);

            var commandLineArgumentsArray = commandLineArguments.ToArray();

            Backend.Current.AddAction(
                "Burst",
                //todo: make burst process pdbs
                inputPaths.Select(p => targetDir.Combine(p.FileName)).Concat(new[] { objectFile }).ToArray(),
                inputPaths.Concat(new[] { BurstExecutable }).ToArray(),
                executableStringFor,
                commandLineArgumentsArray);
        });