Inheritance: GCCToolchain
        public override async Task <IProject> Generate(ISolution solution, string name)
        {
            var project = await base.Generate(solution, name);

            project.ToolChain = IoC.Get <IShell>().ToolChains.FirstOrDefault(tc => tc is ClangToolchain);

            var settings = ClangToolchain.ProvisionClangSettings(project);

            await SourceFile.Create(project, "main.cpp", "int main (void){}");

            project.Save();

            return(project);
        }
Exemple #2
0
        public LinkerSettingsFormViewModel(IProject project) : base("Linker", project)
        {
            try
            {
                try
                {
                    settings = ClangToolchain.GetSettings(project).LinkSettings;
                }
                catch (Exception e)
                {
                    Model.ToolchainSettings.ClangToolchainSettings = new ClangToolchainSettings();
                }
            }
            catch (Exception e)
            {
                Model.ToolchainSettings.ClangToolchainSettings = new ClangToolchainSettings();
                settings = Model.ToolchainSettings.ClangToolchainSettings.LinkSettings;
            }

            if (settings == null)
            {
                settings = new LinkSettings();
            }


            useMemoryLayout       = settings.UseMemoryLayout;
            discardUnusedSections = settings.DiscardUnusedSections;
            notUseStandardStartup = settings.NotUseStandardStartupFiles;
            linkedLibraries       = new ObservableCollection <string>(settings.LinkedLibraries);
            inRom1Start           = string.Format("0x{0:X8}", settings.InRom1Start);
            inRom1Size            = string.Format("0x{0:X8}", settings.InRom1Size);
            inRom2Start           = string.Format("0x{0:X8}", settings.InRom2Start);
            inRom2Size            = string.Format("0x{0:X8}", settings.InRom2Size);
            inRam1Start           = string.Format("0x{0:X8}", settings.InRam1Start);
            inRam1Size            = string.Format("0x{0:X8}", settings.InRam1Size);
            inRam2Start           = string.Format("0x{0:X8}", settings.InRam2Start);
            inRam2Size            = string.Format("0x{0:X8}", settings.InRam2Size);
            scatterFile           = settings.ScatterFile;
            miscOptions           = settings.MiscLinkerArguments;
            librarySelectedIndex  = (int)settings.Library;

            //AddLinkedLibraryCommand = new RoutingCommand(AddLinkedLibrary);
            //RemoveLinkedLibraryCommand = new RoutingCommand(RemoveLinkedLibrary);
            //BrowseScatterFileCommand = new RoutingCommand(BrowseScatterFile);
            //EditScatterFileCommand = new RoutingCommand(EditScatterFile);

            UpdateLinkerString();
        }
Exemple #3
0
        public CompileSettingsFormViewModel(IProject project) : base("Compiler", project)
        {
            try
            {
                settings = ClangToolchain.GetSettings(project).CompileSettings;
            }
            catch (Exception e)
            {
                Model.ToolchainSettings.ClangToolchainSettings = new ClangToolchainSettings();
            }

            defines      = new ObservableCollection <string>(settings.Defines);
            includePaths = new ObservableCollection <string>(settings.Includes);

            //var config = project.SelectedConfiguration;
            //cppSupport = config.CppSupport;
            miscOptions = settings.CustomFlags;
            //includePaths = new ObservableCollection<string>(config.IncludePaths);


            optimizationLevelSelectedIndex      = (int)settings.Optimization;
            optimizationPreferenceSelectedIndex = (int)settings.OptimizationPreference;
            cppLanguageStandardSelectedIndex    = (int)settings.CppLanguageStandard;
            cLanguageStandardSelectedIndex      = (int)settings.CLanguageStandard;
            fpuSelectedIndex = (int)settings.Fpu;
            debugSymbols     = settings.DebugInformation;
            rtti             = settings.Rtti;
            exceptions       = settings.Exceptions;

            AddDefineCommand = ReactiveCommand.Create();
            // new RoutingCommand(AddDefine, (o) => DefineText != string.Empty && DefineText != null && !Defines.Contains(DefineText));
            AddDefineCommand.Subscribe(AddDefine);

            RemoveDefineCommand = ReactiveCommand.Create();
            // new RoutingCommand(RemoveDefine, (o) => SelectedDefine != string.Empty && SelectedDefine != null);
            RemoveDefineCommand.Subscribe(RemoveDefine);

            AddIncludePathCommand = ReactiveCommand.Create();
            AddIncludePathCommand.Subscribe(AddIncludePath);

            RemoveIncludePathCommand = ReactiveCommand.Create();
            RemoveIncludePathCommand.Subscribe(RemoveIncludePath);

            UpdateCompileString();
        }