@@ -34,6 +34,7 @@ interface
34
34
TCompilerOption = record
35
35
Name : integer; // language table index of "Generate debugging info"
36
36
Section: integer; // language table index of "C options"
37
+ IsMake: boolean;
37
38
IsC: boolean;
38
39
IsCpp: boolean; // True (C++ option?) - can be both C and C++ option...
39
40
IsLinker: boolean; // Is it a linker param
@@ -267,6 +268,9 @@ TdevFormatter = class(TPersistent)
267
268
// List of programs to use for unknown file extensions
268
269
TdevExternalPrograms = class (TPersistent)
269
270
private
271
+ fGenericCMD1: String;
272
+ fGenericCMD2: String;
273
+ fGenericCMD3: String;
270
274
fDummy: boolean;
271
275
fPrograms: TStrings;
272
276
function GetProgramName (Index: integer): String;
@@ -283,6 +287,9 @@ TdevExternalPrograms = class(TPersistent)
283
287
published
284
288
property Dummy: boolean read fDummy write fDummy;
285
289
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;
286
293
end ;
287
294
288
295
// global directories
@@ -1499,6 +1506,16 @@ procedure TdevCompilerSet.SetOptions;
1499
1506
AddOption(ID_COPT_WIN32, ID_COPT_LINKERTAB, True, True, True, 0 , ' -mwindows' , nil );
1500
1507
AddOption(ID_COPT_STRIP, ID_COPT_LINKERTAB, False, False, True, 0 , ' -s' , nil );
1501
1508
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
+
1502
1519
// Output
1503
1520
AddOption(ID_COPT_MEM, ID_COPT_GRP_OUTPUT, True, True, False, 0 , ' -fverbose-asm' , nil );
1504
1521
AddOption(ID_COPT_ASSEMBLY, ID_COPT_GRP_OUTPUT, True, True, False, 0 , ' -S' , nil );
@@ -2205,20 +2222,26 @@ procedure TdevCompilerSets.FindSets;
2205
2222
BaseName := BaseSet.Name ;
2206
2223
with BaseSet do begin
2207
2224
Name := BaseName + ' 64-bit Release' ;
2225
+ if FindOption(' -j' , option, index) then
2226
+ SetOption(option, System.CPUCount);
2208
2227
end ;
2209
2228
2210
2229
// Debug profile
2211
2230
with AddSet(BaseSet) do begin
2212
2231
Name := BaseName + ' 64-bit Debug' ;
2213
2232
if FindOption(' -g3' , option, index) then
2214
2233
SetOption(option, 1 );
2234
+ if FindOption(' -j' , option, index) then
2235
+ SetOption(option, 0 );
2215
2236
end ;
2216
2237
2217
2238
// Profiling profile
2218
2239
with AddSet(BaseSet) do begin
2219
2240
Name := BaseName + ' 64-bit Profiling' ;
2220
2241
if FindOption(' -pg' , option, index) then
2221
2242
SetOption(option, 1 );
2243
+ if FindOption(' -j' , option, index) then
2244
+ SetOption(option, 0 );
2222
2245
end ;
2223
2246
2224
2247
// Default, 32bit release profile
@@ -2235,20 +2258,26 @@ procedure TdevCompilerSets.FindSets;
2235
2258
fLibDir[i] := fLibDir[i] + ' 32'
2236
2259
else
2237
2260
fLibDir.Delete(i);
2261
+ if FindOption(' -j' , option, index) then
2262
+ SetOption(option, System.CPUCount);
2238
2263
end ;
2239
2264
2240
2265
// Debug profile
2241
2266
with AddSet(BaseSet) do begin
2242
2267
Name := BaseName + ' 32-bit Debug' ;
2243
2268
if FindOption(' -g3' , option, index) then
2244
2269
SetOption(option, 1 );
2270
+ if FindOption(' -j' , option, index) then
2271
+ SetOption(option, 0 );
2245
2272
end ;
2246
2273
2247
2274
// Profiling profile
2248
2275
with AddSet(BaseSet) do begin
2249
2276
Name := BaseName + ' 32-bit Profiling' ;
2250
2277
if FindOption(' -pg' , option, index) then
2251
2278
SetOption(option, 1 );
2279
+ if FindOption(' -j' , option, index) then
2280
+ SetOption(option, 0 );
2252
2281
end ;
2253
2282
end ;
2254
2283
end ;
@@ -2822,6 +2851,10 @@ procedure TdevExternalPrograms.SaveSettings;
2822
2851
2823
2852
procedure TdevExternalPrograms.SetToDefaults ;
2824
2853
begin
2854
+ fGenericCMD1 := ' ' ;
2855
+ fGenericCMD2 := ' ' ;
2856
+ fGenericCMD3 := ' ' ;
2857
+
2825
2858
inherited ;
2826
2859
end ;
2827
2860
0 commit comments