@@ -34,6 +34,7 @@ interface
3434 TCompilerOption = record
3535 Name : integer; // language table index of "Generate debugging info"
3636 Section: integer; // language table index of "C options"
37+ IsMake: boolean;
3738 IsC: boolean;
3839 IsCpp: boolean; // True (C++ option?) - can be both C and C++ option...
3940 IsLinker: boolean; // Is it a linker param
@@ -267,6 +268,9 @@ TdevFormatter = class(TPersistent)
267268 // List of programs to use for unknown file extensions
268269 TdevExternalPrograms = class (TPersistent)
269270 private
271+ fGenericCMD1: String;
272+ fGenericCMD2: String;
273+ fGenericCMD3: String;
270274 fDummy: boolean;
271275 fPrograms: TStrings;
272276 function GetProgramName (Index: integer): String;
@@ -283,6 +287,9 @@ TdevExternalPrograms = class(TPersistent)
283287 published
284288 property Dummy: boolean read fDummy write fDummy;
285289 property Programs: TStrings read fPrograms write fPrograms;
290+ property GenericCMD1: String read fGenericCMD1 write fGenericCMD1;
291+ property GenericCMD2: String read fGenericCMD2 write fGenericCMD2;
292+ property GenericCMD3: String read fGenericCMD3 write fGenericCMD3;
286293 end ;
287294
288295 // global directories
@@ -1499,6 +1506,16 @@ procedure TdevCompilerSet.SetOptions;
14991506 AddOption(ID_COPT_WIN32, ID_COPT_LINKERTAB, True, True, True, 0 , ' -mwindows' , nil );
15001507 AddOption(ID_COPT_STRIP, ID_COPT_LINKERTAB, False, False, True, 0 , ' -s' , nil );
15011508
1509+ // Make
1510+ sl := TStringList.Create;
1511+ sl.Add(' ' ); // /!\ Must contain a starting empty value in order to do not have always to pass the parameter
1512+ sl.Add(' 1 Thread=1' );
1513+ for var CPUNumber := 2 to System.CPUCount do begin
1514+ sl.Add(CPUNumber.ToString + ' Threads=' + CPUNumber.ToString);
1515+ end ;
1516+ sl.Add(' Auto=' );
1517+ AddOption(ID_MAKEOPT_JOBS, ID_COPT_GRP_MAKE, False, False, False, 0 , ' -j' , sl);
1518+
15021519 // Output
15031520 AddOption(ID_COPT_MEM, ID_COPT_GRP_OUTPUT, True, True, False, 0 , ' -fverbose-asm' , nil );
15041521 AddOption(ID_COPT_ASSEMBLY, ID_COPT_GRP_OUTPUT, True, True, False, 0 , ' -S' , nil );
@@ -2205,20 +2222,26 @@ procedure TdevCompilerSets.FindSets;
22052222 BaseName := BaseSet.Name ;
22062223 with BaseSet do begin
22072224 Name := BaseName + ' 64-bit Release' ;
2225+ if FindOption(' -j' , option, index) then
2226+ SetOption(option, System.CPUCount);
22082227 end ;
22092228
22102229 // Debug profile
22112230 with AddSet(BaseSet) do begin
22122231 Name := BaseName + ' 64-bit Debug' ;
22132232 if FindOption(' -g3' , option, index) then
22142233 SetOption(option, 1 );
2234+ if FindOption(' -j' , option, index) then
2235+ SetOption(option, 0 );
22152236 end ;
22162237
22172238 // Profiling profile
22182239 with AddSet(BaseSet) do begin
22192240 Name := BaseName + ' 64-bit Profiling' ;
22202241 if FindOption(' -pg' , option, index) then
22212242 SetOption(option, 1 );
2243+ if FindOption(' -j' , option, index) then
2244+ SetOption(option, 0 );
22222245 end ;
22232246
22242247 // Default, 32bit release profile
@@ -2235,20 +2258,26 @@ procedure TdevCompilerSets.FindSets;
22352258 fLibDir[i] := fLibDir[i] + ' 32'
22362259 else
22372260 fLibDir.Delete(i);
2261+ if FindOption(' -j' , option, index) then
2262+ SetOption(option, System.CPUCount);
22382263 end ;
22392264
22402265 // Debug profile
22412266 with AddSet(BaseSet) do begin
22422267 Name := BaseName + ' 32-bit Debug' ;
22432268 if FindOption(' -g3' , option, index) then
22442269 SetOption(option, 1 );
2270+ if FindOption(' -j' , option, index) then
2271+ SetOption(option, 0 );
22452272 end ;
22462273
22472274 // Profiling profile
22482275 with AddSet(BaseSet) do begin
22492276 Name := BaseName + ' 32-bit Profiling' ;
22502277 if FindOption(' -pg' , option, index) then
22512278 SetOption(option, 1 );
2279+ if FindOption(' -j' , option, index) then
2280+ SetOption(option, 0 );
22522281 end ;
22532282 end ;
22542283 end ;
@@ -2822,6 +2851,10 @@ procedure TdevExternalPrograms.SaveSettings;
28222851
28232852procedure TdevExternalPrograms.SetToDefaults ;
28242853begin
2854+ fGenericCMD1 := ' ' ;
2855+ fGenericCMD2 := ' ' ;
2856+ fGenericCMD3 := ' ' ;
2857+
28252858 inherited ;
28262859end ;
28272860
0 commit comments