AvalonStudio.Toolchains.LocalGCC.LocalGCCToolchain.GetLinkerArguments C# (CSharp) Method

GetLinkerArguments() public method

public GetLinkerArguments ( IStandardProject superProject, IStandardProject project ) : string
superProject IStandardProject
project IStandardProject
return string
        public override string GetLinkerArguments(IStandardProject superProject, IStandardProject project)
        {
            var settings = GetSettings(project);

            var result = string.Empty;

            result += string.Format("-flto -static-libgcc -static-libstdc++ -Wl,-Map={0}.map ",
                Path.GetFileNameWithoutExtension(project.Name));

            result += string.Format("{0} ", settings.LinkSettings.MiscLinkerArguments);

            if (settings.LinkSettings.DiscardUnusedSections)
            {
                result += "-Wl,--gc-sections ";
            }

            switch (settings.CompileSettings.Optimization)
            {
                case OptimizationLevel.None:
                    result += " -O0";
                    break;

                case OptimizationLevel.Level1:
                    result += " -O1";
                    break;

                case OptimizationLevel.Level2:
                    result += " -O2";
                    break;

                case OptimizationLevel.Level3:
                    result += " -O3";
                    break;
            }

            return result;
        }