Пример #1
0
    static void Main()
    {
        List <BuildCommand> commands = HostPlatform.IsOSX ? MacCommands() : WindowsCommands();

        commands.AddRange(GetAndroidBuildCommands());

        NativeProgram plugin = new NativeProgram("traceeventprofiler")
        {
            Sources = { "src" }
        };

        plugin.CompilerSettingsForIosOrTvos().Add(s => s.WithEmbedBitcode(true));
        plugin.DynamicLinkerSettingsForWindows().Add(s => s.WithDefinitionFile("src/ProfilerPlugin.def"));

        plugin.OutputName.Set(c => DllNameForPlatform(c.ToolChain.Platform));

        foreach (var command in commands)
        {
            var toolchain = command.ToolChain;

            var config       = new NativeProgramConfiguration(CodeGen.Release, toolchain, false);
            var tempDir      = $"artifacts_preprocess/{toolchain.LegacyPlatformIdentifier}";
            var builtProgram = plugin.SetupSpecificConfiguration(config, toolchain.DynamicLibraryFormat).DeployTo(tempDir).Path;
            if (command.PostProcess != null)
            {
                builtProgram = command.PostProcess(builtProgram, toolchain, command.PluginSubFolder);
            }
            Backend.Current.AddAliasDependency(command.Alias, builtProgram);
        }
    }