Ejemplo n.º 1
0
        public override void Start(AssetBuildContext context)
        {
            StringBuilder commandParameter = new StringBuilder();

            commandParameter.AppendFormat(" {0}", DefaultLinkerOptions);
            commandParameter.AppendFormat(" {0}", DefaultLibraries);

            if (context.Target.TargetConfiguration == BuildConfiguration.Debug)
            {
                commandParameter.Append(" /DEBUG /LTCG:INCREMENTAL");
            }
            else
            {
                //commandParameter.Append(" /Ox /MD");
            }

            AddParameterSetting(context, commandParameter, stm_OptionMap);

            var outputPath = PathTool.NormalizePathAndCreate(context.CurrentOutput.SourceFilePath);

            commandParameter.AppendFormat(" /OUT:{0}", outputPath);

            foreach (var input in context.CurrentInputs)
            {
                commandParameter.AppendFormat(" {0}", input.SourceFilePath);
            }

            StartInfo.FileName  = Command;
            StartInfo.Arguments = commandParameter.ToString();
            base.Start(context);
        }
Ejemplo n.º 2
0
        public override void Start(AssetBuildContext context)
        {
            Context = context;
            try
            {
                Output.Clear();
                ErrorOutput.Clear();

                m_RunningProcess           = new Process();
                m_RunningProcess.StartInfo = StartInfo;

                // Enable async events
                m_RunningProcess.EnableRaisingEvents = true;
                m_RunningProcess.Exited             += new EventHandler(ExitHandler);
                m_RunningProcess.OutputDataReceived += new DataReceivedEventHandler(OnOutput);
                m_RunningProcess.ErrorDataReceived  += new DataReceivedEventHandler(OnErrorOutput);

                m_RunningProcess.Start();
                m_RunningProcess.BeginOutputReadLine();
                m_RunningProcess.BeginErrorReadLine();
            }
            catch (Exception exp)
            {
                ToolDebug.Error("Failed to run {0}, {1}", StartInfo.FileName, exp.Message);
                m_RunningProcess = null;
                // Log error.
            }
        }
Ejemplo n.º 3
0
        public override void Start(AssetBuildContext context)
        {
            StringBuilder commandParameter = new StringBuilder();

            commandParameter.AppendFormat("{0}", DefaultCompileOptions);
            commandParameter.AppendFormat(" {0}{1} {0}_{1}", "/D", context.Target.TargetConfiguration.ToString().ToUpper());
            commandParameter.AppendFormat(" {0}{1} {0}_{1}", "/D", context.Target.TargetPlatform.ToString().ToUpper());

            if (context.Target.TargetConfiguration == BuildConfiguration.Debug)
            {
                commandParameter.Append(" /GS /Gs /Ob1 /Od /MDd");
            }
            else
            {
                commandParameter.Append(" /Ox /MD");
            }

            AddParameterSetting(context, commandParameter, stm_OptionMap);

            var outputPath = PathTool.NormalizePathAndCreate(context.CurrentOutput.SourceFilePath);

            commandParameter.AppendFormat(" /Fo:{0}", outputPath);

            foreach (var input in context.CurrentInputs)
            {
                commandParameter.AppendFormat(" {0}", input.SourceFilePath);
            }

            StartInfo.FileName  = GetCommandPath();
            StartInfo.Arguments = commandParameter.ToString();
            base.Start(context);
        }
Ejemplo n.º 4
0
        public override void Start(AssetBuildContext context)
        {
            StringBuilder commandParameter = new StringBuilder();

            commandParameter.AppendFormat("{0}", DefaultCompileOptions);
            commandParameter.AppendFormat(" {0}{1} {0}_{1}", "-D", context.Target.TargetConfiguration.ToString().ToUpper());
            commandParameter.AppendFormat(" {0}{1} {0}_{1}", "-D", context.Target.TargetPlatform.ToString().ToUpper());

            if (context.Target.TargetConfiguration == BuildConfiguration.Debug)
            {
                commandParameter.Append(" -O0");
            }
            else
            {
                commandParameter.Append(" -Ofast");
            }

            AddParameterSetting(context, commandParameter, stm_OptionMap);

            commandParameter.AppendFormat(" -o:{0}", context.CurrentOutput.ResourcePath);

            foreach (var input in context.CurrentInputs)
            {
                commandParameter.AppendFormat(" {0}", input.ResourcePath);
            }

            StartInfo.FileName  = Command;
            StartInfo.Arguments = commandParameter.ToString();
            base.Start(context);
        }
Ejemplo n.º 5
0
        protected void AddParameterSetting(AssetBuildContext context, StringBuilder commandBuilder, Dictionary <string, string> optionMap)
        {
            foreach (var setting in context.Parameters)
            {
                AddParameterSetting(commandBuilder, optionMap, setting);
            }

            foreach (var setting in ParameterSetting)
            {
                AddParameterSetting(commandBuilder, optionMap, setting);
            }
        }
Ejemplo n.º 6
0
        public override void Start(AssetBuildContext context)
        {
            StringBuilder commandParameter = new StringBuilder();

            commandParameter.AppendFormat(" {0}", DefaultLibOptions);

            AddParameterSetting(context, commandParameter, stm_OptionMap);

            StartInfo.FileName  = Command;
            StartInfo.Arguments = commandParameter.ToString();
            base.Start(context);
        }
Ejemplo n.º 7
0
        public override void Start(AssetBuildContext context)
        {
            StringBuilder commandParameter = new StringBuilder();

            commandParameter.AppendFormat(" {0}", DefaultLibOptions);

            AddParameterSetting(context, commandParameter, stm_OptionMap);

            var outputPath = PathTool.NormalizePathAndCreate(context.CurrentOutput.SourceFilePath);

            commandParameter.AppendFormat(" /OUT:{0}", outputPath);

            foreach (var input in context.CurrentInputs)
            {
                commandParameter.AppendFormat(" {0}", input.SourceFilePath);
            }

            StartInfo.FileName  = Command;
            StartInfo.Arguments = commandParameter.ToString();
            base.Start(context);
        }
Ejemplo n.º 8
0
 public abstract void Start(AssetBuildContext context);