Skip to content

Commit

Permalink
Version 6.3
Browse files Browse the repository at this point in the history
Added parallel compilation and bug fixes.
  • Loading branch information
FMXExpress committed Jan 31, 2021
1 parent 33f1eac commit 26c14f0
Show file tree
Hide file tree
Showing 13 changed files with 266 additions and 17 deletions.
2 changes: 2 additions & 0 deletions Lang/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ Ver=1
43002=C++ compiler
43003=Compiler:
43004=Output
43005=Make


44001=Support all ANSI standard C programs (-ansi)
Expand Down Expand Up @@ -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:
Expand Down
11 changes: 11 additions & 0 deletions NEWS.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 24 additions & 2 deletions Source/Compiler.pas
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ TCompiler = class
protected
fCompileParams: String;
fCppCompileParams: String;
fMakeParams: String;
fLibrariesParams: String;
fIncludesParams: String;
fCppIncludesParams: String;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand All @@ -586,6 +607,7 @@ procedure TCompiler.GetCompileParams;

fCompileParams := Trim(ParseMacros(fCompileParams));
fCppCompileParams := Trim(ParseMacros(fCppCompileParams));
fMakeParams := Trim(ParseMacros(fMakeParams));
end;

procedure TCompiler.CheckSyntax;
Expand All @@ -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;
Expand Down Expand Up @@ -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('--------');
Expand Down
8 changes: 6 additions & 2 deletions Source/LangIDs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/Version.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
33 changes: 33 additions & 0 deletions Source/devCFG.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -2205,20 +2222,26 @@ 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
with AddSet(BaseSet) do begin
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
with AddSet(BaseSet) do begin
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
Expand All @@ -2235,20 +2258,26 @@ 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
with AddSet(BaseSet) do begin
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
with AddSet(BaseSet) do begin
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;
Expand Down Expand Up @@ -2822,6 +2851,10 @@ procedure TdevExternalPrograms.SaveSettings;

procedure TdevExternalPrograms.SetToDefaults;
begin
fGenericCMD1 := '';
fGenericCMD2 := '';
fGenericCMD3 := '';

inherited;
end;

Expand Down
75 changes: 71 additions & 4 deletions Source/main.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -573,23 +573,23 @@ object MainForm: TMainForm
Style = tsButtons
TabOrder = 0
end
object Panel1: TPanel
object ConsolePanel: TPanel
Left = 0
Top = 0
Width = 33
Height = 138
Align = alLeft
BevelOuter = bvNone
TabOrder = 1
object SpeedButton5: TSpeedButton
object CMDSpeedButton: TSpeedButton
Left = 0
Top = 0
Width = 33
Height = 33
Action = actCMD
Align = alTop
end
object SpeedButton6: TSpeedButton
object PSSpeedButton: TSpeedButton
Left = 0
Top = 33
Width = 33
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Loading

2 comments on commit 26c14f0

@Venky725
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not accepting the functions like fork (),getppid(),etc.....

@pmcgee69
Copy link
Contributor

@pmcgee69 pmcgee69 commented on 26c14f0 Jan 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not accepting the functions like fork (),getppid(),etc.....

fork() is linux, not windows.
Apparently you can use cygwin (but maybe not with Dev-cpp). Or use gcc under WSL linux.

Please sign in to comment.