static string[] GetBurstCommandLineArgs(BurstCompiler compiler, NPath outputPrefixForObjectFile, NPath outputDirForPatchedAssemblies, string pinvokeName, DotNetAssembly[] inputAssemblies)
    {
        var commandLineArguments = new[]
        {
            $"--platform={compiler.TargetPlatform}",
            $"--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",
            compiler.Verbose ? "--verbose" : "",
            $"--patch-assemblies-into={outputDirForPatchedAssemblies}",
            $"--output={outputPrefixForObjectFile}",
            compiler.OnlyStaticMethods ? "--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" });
        }

        if (!HostPlatform.IsWindows)
        {
            commandLineArguments = new[] { BurstExecutable.ToString(SlashMode.Native) }
        }
Example #2
0
    } = "";                                                    // ; seperated list of ids, e.g. BC1370;BC1322

    static string[] GetBurstCommandLineArgs(
        BurstCompiler compiler,
        NPath outputPrefixForObjectFile,
        NPath outputDirForPatchedAssemblies,
        string pinvokeName,
        DotNetAssembly[] inputAssemblies)
    {
        var commandLineArguments = new[]
        {
            $"--platform={compiler.TargetPlatform}",
            $"--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",
            compiler.Verbose ? "--verbose" : "",
            $"--patch-assemblies-into={outputDirForPatchedAssemblies}",
            $"--output={outputPrefixForObjectFile}",
            compiler.OnlyStaticMethods ? "--only-static-methods" : "",
            "--method-prefix=burstedmethod_",
            $"--pinvoke-name={pinvokeName}",
            $"--backend={compiler.BurstBackend}",
            $"--execute-method-name={compiler.ExecuteMethodName}",
            "--debug=Full",
            compiler.EnableDirectExternalLinking ? "--enable-direct-external-linking" : "",
            compiler.DisableOpt ? "--disable-opt" : "",
            $"--threads={compiler.Threads}",
            compiler.EnableGuard ? "--enable-guard" : "",
            !String.IsNullOrEmpty(compiler.DisableWarnings) ? $"--disable-warnings={compiler.DisableWarnings}" : ""
        }.Concat(inputAssemblies.Select(asm => $"--root-assembly={asm.Path}"));

        if (!compiler.UseOwnToolchain)
        {
            commandLineArguments = commandLineArguments.Concat(new[] { "--no-native-toolchain" });
        }


        if (!HostPlatform.IsWindows)
        {
            commandLineArguments = new[] { BurstExecutable.ToString(SlashMode.Native) }
        }
Example #3
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);
        });