From 26c14f051c7a51a276079e0c9c557e83cb0aa1d2 Mon Sep 17 00:00:00 2001 From: FMXExpress Date: Sat, 30 Jan 2021 16:57:51 -0800 Subject: [PATCH] Version 6.3 Added parallel compilation and bug fixes. --- Lang/English.lng | 2 + NEWS.txt | 11 ++++ Source/Compiler.pas | 26 +++++++- Source/LangIDs.inc | 8 ++- Source/Version.pas | 2 +- Source/devCFG.pas | 33 ++++++++++ Source/main.dfm | 75 +++++++++++++++++++++-- Source/main.pas | 116 +++++++++++++++++++++++++++++++++++- devcppmingw64.nsi | 2 +- devcppnocompiler.nsi | 2 +- devcppnocompilerNoFonts.nsi | 2 +- devcpptdmgcc64.nsi | 2 +- devcpptdmgcc64NoFonts.nsi | 2 +- 13 files changed, 266 insertions(+), 17 deletions(-) diff --git a/Lang/English.lng b/Lang/English.lng index 703c7825..1b78e045 100644 --- a/Lang/English.lng +++ b/Lang/English.lng @@ -607,6 +607,7 @@ Ver=1 43002=C++ compiler 43003=Compiler: 43004=Output +43005=Make 44001=Support all ANSI standard C programs (-ansi) @@ -1145,6 +1146,7 @@ Ver=1 73005=Language standard (-std) 73006=Compile with the following pointer width (-mx) 73007=Optimize less, while maintaining full compatibility (-mtune) +73008=Concurrent compilation processes (-j) 74001=Compiler: diff --git a/NEWS.txt b/NEWS.txt index fcc03b72..79ea5376 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,14 @@ +Version 6.3 - 30 January 2021 + + - Added: Parallel compilation enabled by default for release builds through MAKE Jobs. + - Added: 3 Buttons for setting up custom shell command line tabs. + - Updated: Code completion and menues for dark themes. + - Updated: CTRL-TAB editor tab selection wrapping. + - Fixed: Make clean file deletion issue. + - Fixed: Status bar not showing all text. + - Fixed: Debug/CPU Window hex column issue. + - Fixed: Closing tabs in editor side by side view. + Version 6.2 - 13 November 2020 - Added: 5 new UI styles. Windows 10 Black Pearl, Glossy, Calypso, Flat UI Light, Material Patterns Blue diff --git a/Source/Compiler.pas b/Source/Compiler.pas index 63c0b439..edb5c7ff 100644 --- a/Source/Compiler.pas +++ b/Source/Compiler.pas @@ -89,6 +89,7 @@ TCompiler = class protected fCompileParams: String; fCppCompileParams: String; + fMakeParams: String; fLibrariesParams: String; fIncludesParams: String; fCppIncludesParams: String; @@ -523,9 +524,11 @@ procedure TCompiler.GetCompileParams; if fCheckSyntax then begin fCompileParams := '-fsyntax-only'; fCppCompileParams := '-fsyntax-only'; + fMakeParams := ''; end else begin fCompileParams := ''; fCppCompileParams := ''; + fMakeParams := ''; end; // Walk all options @@ -563,6 +566,24 @@ procedure TCompiler.GetCompileParams; fCppCompileParams := fCppCompileParams + ' ' + option.Setting; end; end; + if (not option.IsC) AND (not option.IsCpp) AND (not option.IsLinker) then begin + if option.Setting='-j' then + begin + if Assigned(option.Choices) then begin + if Assigned(fProject) then + val := fProject.Options.CompilerOptions[I] + else + val := option.Value; + if (val > 0) and (val < option.Choices.Count) then + fMakeParams := fMakeParams + ' ' + option.Setting + + option.Choices.Values[option.Choices.Names[val]]; + end else if (Assigned(fProject) and (fProject.Options.CompilerOptions[I] = 1)) or (not + Assigned(fProject)) then begin + fMakeParams := fMakeParams + ' ' + option.Setting + option.Choices.Values[option.Choices.Names[val]]; + end; + end; + end; + end; end; @@ -586,6 +607,7 @@ procedure TCompiler.GetCompileParams; fCompileParams := Trim(ParseMacros(fCompileParams)); fCppCompileParams := Trim(ParseMacros(fCppCompileParams)); + fMakeParams := Trim(ParseMacros(fMakeParams)); end; procedure TCompiler.CheckSyntax; @@ -606,7 +628,7 @@ procedure TCompiler.Compile; // gcc, input, output, compileparams, includeparams, librariesparams cSourceCmdLine = '%s "%s" -o "%s" %s %s %s'; // make, makefile - cMakeLine = '%s -f "%s" all'; + cMakeLine = '%s %s -f "%s" all'; var cmdline: String; s: String; @@ -713,7 +735,7 @@ procedure TCompiler.Compile; DoLogEntry(''); BuildMakeFile; - cmdline := Format(cMakeLine, [fCompilerSet.makeName, fMakeFile]); + cmdline := Format(cMakeLine, [fCompilerSet.makeName, fMakeParams, fMakeFile]); DoLogEntry(Lang[ID_LOG_PROCESSINGMAKE]); DoLogEntry('--------'); diff --git a/Source/LangIDs.inc b/Source/LangIDs.inc index d6419fa3..aba8d2c2 100644 --- a/Source/LangIDs.inc +++ b/Source/LangIDs.inc @@ -650,6 +650,7 @@ const ID_COPT_GRP_CPP = 43002; ID_COPT_GRP_COMP = 43003; ID_COPT_GRP_OUTPUT = 43004; + ID_COPT_GRP_MAKE = 43005; // free to 725 for new groups ID_COPT_ANSIC = 44001; @@ -1191,7 +1192,7 @@ const ID_POPT_RESETPROJECTCOMPILER = 72030; ID_POPT_LANGUAGEDEP = 72031; ID_POPT_FILES = 72032; - + // New compiler options ID_COPT_STRIP = 73001; ID_COPT_ARCH = 73002; @@ -1201,6 +1202,9 @@ const ID_COPT_PTRWIDTH = 73006; ID_COPT_TUNE = 73007; + // New make option + ID_MAKEOPT_JOBS = 73008; + // Compile progress window ID_CMPRPG_COMPILER = 74001; ID_CMPPRG_STATUS = 74002; @@ -1250,7 +1254,7 @@ const ID_LANGFORM_WAIT = 76019; ID_LANGFORM_SAVING = 76020; ID_LANGFORM_DONEPARSINGSAVING = 76021; - + ID_LOAD_COMPILERSET = 77001; ID_LOAD_FILEASSOC = 77002; ID_LOAD_INITCLASSBROWSER = 77003; diff --git a/Source/Version.pas b/Source/Version.pas index c3562da0..80fef4e2 100644 --- a/Source/Version.pas +++ b/Source/Version.pas @@ -32,7 +32,7 @@ interface // exe properties DEVCPP = 'Embarcadero Dev-C++'; - DEVCPP_VERSION = '6.2'; + DEVCPP_VERSION = '6.3'; // delimiters DEV_INTERNAL_OPEN = '$__DEV_INTERNAL_OPEN'; diff --git a/Source/devCFG.pas b/Source/devCFG.pas index 650b8971..c0444633 100644 --- a/Source/devCFG.pas +++ b/Source/devCFG.pas @@ -34,6 +34,7 @@ interface TCompilerOption = record Name: integer; // language table index of "Generate debugging info" Section: integer; // language table index of "C options" + IsMake: boolean; IsC: boolean; IsCpp: boolean; // True (C++ option?) - can be both C and C++ option... IsLinker: boolean; // Is it a linker param @@ -267,6 +268,9 @@ TdevFormatter = class(TPersistent) // List of programs to use for unknown file extensions TdevExternalPrograms = class(TPersistent) private + fGenericCMD1: String; + fGenericCMD2: String; + fGenericCMD3: String; fDummy: boolean; fPrograms: TStrings; function GetProgramName(Index: integer): String; @@ -283,6 +287,9 @@ TdevExternalPrograms = class(TPersistent) published property Dummy: boolean read fDummy write fDummy; property Programs: TStrings read fPrograms write fPrograms; + property GenericCMD1: String read fGenericCMD1 write fGenericCMD1; + property GenericCMD2: String read fGenericCMD2 write fGenericCMD2; + property GenericCMD3: String read fGenericCMD3 write fGenericCMD3; end; // global directories @@ -1499,6 +1506,16 @@ procedure TdevCompilerSet.SetOptions; AddOption(ID_COPT_WIN32, ID_COPT_LINKERTAB, True, True, True, 0, '-mwindows', nil); AddOption(ID_COPT_STRIP, ID_COPT_LINKERTAB, False, False, True, 0, '-s', nil); + // Make + sl := TStringList.Create; + sl.Add(''); // /!\ Must contain a starting empty value in order to do not have always to pass the parameter + sl.Add('1 Thread=1'); + for var CPUNumber := 2 to System.CPUCount do begin + sl.Add(CPUNumber.ToString + ' Threads=' + CPUNumber.ToString); + end; + sl.Add('Auto='); + AddOption(ID_MAKEOPT_JOBS, ID_COPT_GRP_MAKE, False, False, False, 0, '-j', sl); + // Output AddOption(ID_COPT_MEM, ID_COPT_GRP_OUTPUT, True, True, False, 0, '-fverbose-asm', nil); AddOption(ID_COPT_ASSEMBLY, ID_COPT_GRP_OUTPUT, True, True, False, 0, '-S', nil); @@ -2205,6 +2222,8 @@ procedure TdevCompilerSets.FindSets; BaseName := BaseSet.Name; with BaseSet do begin Name := BaseName + ' 64-bit Release'; + if FindOption('-j', option, index) then + SetOption(option, System.CPUCount); end; // Debug profile @@ -2212,6 +2231,8 @@ procedure TdevCompilerSets.FindSets; Name := BaseName + ' 64-bit Debug'; if FindOption('-g3', option, index) then SetOption(option, 1); + if FindOption('-j', option, index) then + SetOption(option, 0); end; // Profiling profile @@ -2219,6 +2240,8 @@ procedure TdevCompilerSets.FindSets; Name := BaseName + ' 64-bit Profiling'; if FindOption('-pg', option, index) then SetOption(option, 1); + if FindOption('-j', option, index) then + SetOption(option, 0); end; // Default, 32bit release profile @@ -2235,6 +2258,8 @@ procedure TdevCompilerSets.FindSets; fLibDir[i] := fLibDir[i] + '32' else fLibDir.Delete(i); + if FindOption('-j', option, index) then + SetOption(option, System.CPUCount); end; // Debug profile @@ -2242,6 +2267,8 @@ procedure TdevCompilerSets.FindSets; Name := BaseName + ' 32-bit Debug'; if FindOption('-g3', option, index) then SetOption(option, 1); + if FindOption('-j', option, index) then + SetOption(option, 0); end; // Profiling profile @@ -2249,6 +2276,8 @@ procedure TdevCompilerSets.FindSets; Name := BaseName + ' 32-bit Profiling'; if FindOption('-pg', option, index) then SetOption(option, 1); + if FindOption('-j', option, index) then + SetOption(option, 0); end; end; end; @@ -2822,6 +2851,10 @@ procedure TdevExternalPrograms.SaveSettings; procedure TdevExternalPrograms.SetToDefaults; begin + fGenericCMD1 := ''; + fGenericCMD2 := ''; + fGenericCMD3 := ''; + inherited; end; diff --git a/Source/main.dfm b/Source/main.dfm index 324f0150..3cf50759 100644 --- a/Source/main.dfm +++ b/Source/main.dfm @@ -573,7 +573,7 @@ object MainForm: TMainForm Style = tsButtons TabOrder = 0 end - object Panel1: TPanel + object ConsolePanel: TPanel Left = 0 Top = 0 Width = 33 @@ -581,7 +581,7 @@ object MainForm: TMainForm Align = alLeft BevelOuter = bvNone TabOrder = 1 - object SpeedButton5: TSpeedButton + object CMDSpeedButton: TSpeedButton Left = 0 Top = 0 Width = 33 @@ -589,7 +589,7 @@ object MainForm: TMainForm Action = actCMD Align = alTop end - object SpeedButton6: TSpeedButton + object PSSpeedButton: TSpeedButton Left = 0 Top = 33 Width = 33 @@ -599,6 +599,41 @@ object MainForm: TMainForm ExplicitLeft = 7 ExplicitTop = 64 end + object G1SpeedButton: TSpeedButton + Tag = 1 + Left = 0 + Top = 66 + Width = 33 + Height = 33 + Action = actGeneric1CMD + Align = alTop + PopupMenu = GenericCMDPopupMenu + ExplicitLeft = 7 + ExplicitTop = 105 + end + object G2SpeedButton: TSpeedButton + Tag = 2 + Left = 0 + Top = 99 + Width = 33 + Height = 33 + Action = actGeneric2CMD + Align = alTop + PopupMenu = GenericCMDPopupMenu + ExplicitLeft = -6 + ExplicitTop = 92 + end + object G3SpeedButton: TSpeedButton + Tag = 3 + Left = 0 + Top = 132 + Width = 33 + Height = 33 + Action = actGeneric3CMD + Align = alTop + PopupMenu = GenericCMDPopupMenu + ExplicitTop = 131 + end end end object CloseSheet: TTabSheet @@ -1621,7 +1656,7 @@ object MainForm: TMainForm Top = 309 Width = 18 Height = 16 - Caption = '6.2' + Caption = '6.3' Font.Charset = DEFAULT_CHARSET Font.Color = clRed Font.Height = -13 @@ -6427,6 +6462,24 @@ object MainForm: TMainForm Caption = 'Close' OnExecute = actConsoleCloseExecute end + object actGeneric1CMD: TAction + Tag = 1 + Caption = '$1' + OnExecute = actGeneric1CMDExecute + end + object actGeneric2CMD: TAction + Tag = 2 + Caption = '$2' + OnExecute = actGeneric2CMDExecute + end + object actGeneric3CMD: TAction + Tag = 3 + Caption = '$3' + OnExecute = actGeneric3CMDExecute + end + object actGenericSet: TAction + Caption = 'Set' + end end object MessagePopup: TPopupMenu Left = 11 @@ -6613,4 +6666,18 @@ object MainForm: TMainForm Action = actConsoleClose end end + object OpenConsoleDialog: TOpenDialog + DefaultExt = 'exe' + Filter = 'Executables (*.exe)|*.EXE' + Left = 60 + Top = 275 + end + object GenericCMDPopupMenu: TPopupMenu + Left = 76 + Top = 379 + object SetCMDMNU: TMenuItem + Caption = 'Set' + OnClick = SetCMDMNUClick + end + end end diff --git a/Source/main.pas b/Source/main.pas index e7f525dc..6124313b 100644 --- a/Source/main.pas +++ b/Source/main.pas @@ -578,9 +578,9 @@ TMainForm = class(TForm) SpeedButton4: TSpeedButton; RichEdit0: TRichEdit; ClassBrowser: TClassBrowser; - Panel1: TPanel; - SpeedButton5: TSpeedButton; - SpeedButton6: TSpeedButton; + ConsolePanel: TPanel; + CMDSpeedButton: TSpeedButton; + PSSpeedButton: TSpeedButton; actCMD: TAction; actPowerShell: TAction; ConsolePopupMenu: TPopupMenu; @@ -594,6 +594,16 @@ TMainForm = class(TForm) PanelDescRun: TPanel; PanelDescCompile: TPanel; PanelDescClear: TPanel; + G1SpeedButton: TSpeedButton; + G2SpeedButton: TSpeedButton; + G3SpeedButton: TSpeedButton; + actGeneric1CMD: TAction; + actGeneric2CMD: TAction; + actGeneric3CMD: TAction; + OpenConsoleDialog: TOpenDialog; + GenericCMDPopupMenu: TPopupMenu; + actGenericSet: TAction; + SetCMDMNU: TMenuItem; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormDestroy(Sender: TObject); procedure ToggleBookmarkClick(Sender: TObject); @@ -874,6 +884,10 @@ TMainForm = class(TForm) procedure actCMDExecute(Sender: TObject); procedure actPowerShellExecute(Sender: TObject); procedure actConsoleCloseExecute(Sender: TObject); + procedure actGeneric1CMDExecute(Sender: TObject); + procedure actGeneric2CMDExecute(Sender: TObject); + procedure actGeneric3CMDExecute(Sender: TObject); + procedure SetCMDMNUClick(Sender: TObject); private FCloseButtonMouseDownTab: TCloseTabSheet; FCloseButtonShowPushed: Boolean; @@ -935,6 +949,8 @@ TMainForm = class(TForm) procedure OpenFileProject(s: string; AEncoding: TEncoding = nil); procedure ResizeWelcomeComponent; + procedure ExecuteGenericConsole(Sender: TObject); + procedure PageControlCloseButtonDrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); procedure PageControlCloseButtonMouseDown(Sender: TObject; @@ -1156,6 +1172,31 @@ procedure TMainForm.BuildBookMarkMenus; CloneMenu(GotoBookmarksItem, GotobookmarksPopItem); end; +procedure TMainForm.SetCMDMNUClick(Sender: TObject); +var + LCommandLine: String; +begin + case TSpeedButton(((Sender as TMenuItem).GetParentMenu as TPopupMenu).PopupComponent).Tag of + 1: LCommandLine := devExternalPrograms.GenericCMD1; + 2: LCommandLine := devExternalPrograms.GenericCMD2; + 3: LCommandLine := devExternalPrograms.GenericCMD3; + end; + + if OpenConsoleDialog.Execute then begin + case TSpeedButton(((Sender as TMenuItem).GetParentMenu as TPopupMenu).PopupComponent).Tag of + 1: begin + devExternalPrograms.GenericCMD1 := OpenConsoleDialog.FileName; + end; + 2: begin + devExternalPrograms.GenericCMD2 := OpenConsoleDialog.FileName; + end; + 3: begin + devExternalPrograms.GenericCMD3 := OpenConsoleDialog.FileName; + end; + end; + end; +end; + procedure TMainForm.SetHints; var idx: integer; @@ -6914,6 +6955,75 @@ procedure TMainForm.actOpenFolderExecute(Sender: TObject); end; end; +procedure TMainForm.ExecuteGenericConsole(Sender: TObject); +var + LCommandLine: String; +begin + case TAction(Sender).Tag of + 1: LCommandLine := devExternalPrograms.GenericCMD1; + 2: LCommandLine := devExternalPrograms.GenericCMD2; + 3: LCommandLine := devExternalPrograms.GenericCMD3; + end; + + if LCommandLine='' then begin + if OpenConsoleDialog.Execute then begin + case TAction(Sender).Tag of + 1: begin + devExternalPrograms.GenericCMD1 := OpenConsoleDialog.FileName; + LCommandLine := devExternalPrograms.GenericCMD1; + end; + 2: begin + devExternalPrograms.GenericCMD2 := OpenConsoleDialog.FileName; + LCommandLine := devExternalPrograms.GenericCMD2; + end; + 3: begin + devExternalPrograms.GenericCMD3 := OpenConsoleDialog.FileName; + LCommandLine := devExternalPrograms.GenericCMD3; + end; + end; + + end; + end; + + if LCommandLine<>'' then begin + + var ConsoleFrameProc: TProc := + procedure (AFrame: TConsoleAppHost; AIsSuccess: Boolean) + begin + if AIsSuccess then + begin + var NewTab := TTabSheet.Create(pcConsoleHost); + NewTab.PageControl := pcConsoleHost; + NewTab.Assign(AFrame); + end + else + for var i := 0 to pcConsoleHost.PageCount - 1 do + if pcConsoleHost.Pages[i].Tag = NativeInt(AFrame) then + begin + pcConsoleHost.Pages[i].Free; + Break; + end; + end; + + TConsoleAppHost.NewHost(LCommandLine, TAction(Sender).Caption, ConsoleFrameProc, 20); + end; +end; + +procedure TMainForm.actGeneric1CMDExecute(Sender: TObject); +begin + ExecuteGenericConsole(Sender); +end; + +procedure TMainForm.actGeneric2CMDExecute(Sender: TObject); +begin + ExecuteGenericConsole(Sender); +end; + +procedure TMainForm.actGeneric3CMDExecute(Sender: TObject); +begin + ExecuteGenericConsole(Sender); +end; + procedure TMainForm.actGotoBreakPointExecute(Sender: TObject); var e: TEditor; diff --git a/devcppmingw64.nsi b/devcppmingw64.nsi index ee443d2a..e8cf82e6 100644 --- a/devcppmingw64.nsi +++ b/devcppmingw64.nsi @@ -3,7 +3,7 @@ !define COMPILERNAME "TDM-GCC 4.9.2" !define COMPILERFOLDER "MinGW64" -!define DEVCPP_VERSION "6.2" +!define DEVCPP_VERSION "6.3" !define FINALNAME "Embarcadero_Dev-Cpp_${DEVCPP_VERSION}_${COMPILERNAME}_Setup.exe" !define DISPLAY_NAME "Embarcadero Dev-C++ ${DEVCPP_VERSION}" diff --git a/devcppnocompiler.nsi b/devcppnocompiler.nsi index d3531937..05095aa9 100644 --- a/devcppnocompiler.nsi +++ b/devcppnocompiler.nsi @@ -3,7 +3,7 @@ !define COMPILERNAME "No Compiler" !define COMPILERFOLDER "" -!define DEVCPP_VERSION "6.2" +!define DEVCPP_VERSION "6.3" !define FINALNAME "Embarcadero_Dev-Cpp_${DEVCPP_VERSION}_${COMPILERNAME}_Setup.exe" !define DISPLAY_NAME "Embarcadero Dev-C++ ${DEVCPP_VERSION}" diff --git a/devcppnocompilerNoFonts.nsi b/devcppnocompilerNoFonts.nsi index 8557d11a..dc26d283 100644 --- a/devcppnocompilerNoFonts.nsi +++ b/devcppnocompilerNoFonts.nsi @@ -3,7 +3,7 @@ !define COMPILERNAME "No Compiler" !define COMPILERFOLDER "" -!define DEVCPP_VERSION "6.2" +!define DEVCPP_VERSION "6.3" !define FINALNAME "Embarcadero_Dev-Cpp_${DEVCPP_VERSION}_${COMPILERNAME}_Setup.exe" !define DISPLAY_NAME "Embarcadero Dev-C++ ${DEVCPP_VERSION}" diff --git a/devcpptdmgcc64.nsi b/devcpptdmgcc64.nsi index 7de61530..db17c295 100644 --- a/devcpptdmgcc64.nsi +++ b/devcpptdmgcc64.nsi @@ -3,7 +3,7 @@ !define COMPILERNAME "TDM-GCC 9.2" !define COMPILERFOLDER "TDM-GCC-64" -!define DEVCPP_VERSION "6.2" +!define DEVCPP_VERSION "6.3" !define FINALNAME "Embarcadero_Dev-Cpp_${DEVCPP_VERSION}_${COMPILERNAME}_Setup.exe" !define DISPLAY_NAME "Embarcadero Dev-C++ ${DEVCPP_VERSION}" diff --git a/devcpptdmgcc64NoFonts.nsi b/devcpptdmgcc64NoFonts.nsi index 0e8c7458..23f5bef8 100644 --- a/devcpptdmgcc64NoFonts.nsi +++ b/devcpptdmgcc64NoFonts.nsi @@ -3,7 +3,7 @@ !define COMPILERNAME "TDM-GCC 9.2" !define COMPILERFOLDER "TDM-GCC-64" -!define DEVCPP_VERSION "6.2" +!define DEVCPP_VERSION "6.3" !define FINALNAME "Embarcadero_Dev-Cpp_${DEVCPP_VERSION}_${COMPILERNAME}_Setup.exe" !define DISPLAY_NAME "Embarcadero Dev-C++ ${DEVCPP_VERSION}"