50
50
rtRes // fpc resources
56
Every package/project can define build macros. A build macro has a name,
57
a description, a list of possible values and a default value.
58
The default value can be an expression using other build macros.
59
The IDE defines basic macros like TargetOS and TargetCPU.
60
The LCL package defines the macro LCLWidgetType. }
62
TLazBuildMacro = class
64
FDefaultValue: string;
67
FValueDescriptions: TStrings;
69
procedure SetIdentifier(const AValue: string); virtual; abstract;
70
procedure SetDescription(const AValue: string); virtual; abstract;
71
procedure SetValueDescriptions(const AValue: TStrings); virtual; abstract;
72
procedure SetValues(const AValue: TStrings); virtual; abstract;
74
procedure Assign(Source: TLazBuildMacro); virtual; abstract;
75
property Identifier: string read FIdentifier write SetIdentifier;
76
property Description: string read FDescription write SetDescription;
77
property Values: TStrings read FValues write SetValues;
78
property ValueDescriptions: TStrings read FValueDescriptions write SetValueDescriptions;
82
The list of build macros of a package/project.
83
They are stored in the compiler options. }
85
TLazBuildMacros = class
89
function GetItems(Index: integer): TLazBuildMacro; virtual; abstract;
91
constructor Create(TheOwner: TObject); virtual;
92
function Add(Identifier: string): TLazBuildMacro; virtual; abstract;
93
procedure Delete(Index: integer); virtual; abstract;
94
procedure Move(OldIndex, NewIndex: integer); virtual; abstract;
95
function IndexOfIdentifier(Identifier: string): integer; virtual; abstract;
96
function VarWithIdentifier(Identifier: string): TLazBuildMacro; virtual; abstract;
97
function Count: integer; virtual; abstract;
98
procedure Clear; virtual; abstract;
99
property Items[Index: integer]: TLazBuildMacro read GetItems; default;
100
property Owner: TObject read FOwner;
103
{ TLazCompilerOptions }
105
TCompilationExecutableType = (
111
crCompile, // normal build current project/package
112
crBuild, // build all
113
crRun // quick build before run
115
TCompileReasons = set of TCompileReason;
117
crAll = [crCompile, crBuild, crRun];
120
{ TLazCompilerOptions }
122
TLazCompilerOptions = class(TAbstractIDEProjectOptions)
124
FOnModified: TNotifyEvent;
126
SetEmulatedFloatOpcodes: boolean;
127
procedure SetAllowLabel(const AValue: Boolean);
128
procedure SetAssemblerStyle(const AValue: Integer);
129
procedure SetCMacros(const AValue: Boolean);
130
procedure SetConfigFilePath(const AValue: String);
131
procedure SetCPPInline(const AValue: Boolean);
132
procedure SetCStyleOp(const AValue: Boolean);
133
procedure SetCustomConfigFile(const AValue: Boolean);
134
procedure SetDontUseConfigFile(const AValue: Boolean);
135
procedure SetExecutableType(const AValue: TCompilationExecutableType);
136
procedure SetGenDebugInfo(const AValue: Boolean);
137
procedure SetGenerateDwarf(const AValue: Boolean);
138
procedure SetGenGProfCode(const AValue: Boolean);
139
procedure SetHeapSize(const AValue: Integer);
140
procedure SetIncludeAssertionCode(const AValue: Boolean);
141
procedure SetInitConst(const AValue: Boolean);
142
procedure SetIOChecks(const AValue: Boolean);
143
procedure SetLinkSmart(const AValue: Boolean);
144
procedure SetOptLevel(const AValue: Integer);
145
procedure SetOverflowChecks(const AValue: Boolean);
146
procedure SetPassLinkerOpt(const AValue: Boolean);
147
procedure SetRangeChecks(const AValue: Boolean);
148
procedure SetShowAll(const AValue: Boolean);
149
procedure SetShowAllProcsOnError(const AValue: Boolean);
150
procedure SetShowCompProc(const AValue: Boolean);
151
procedure SetShowCond(const AValue: Boolean);
152
procedure SetShowDebugInfo(const AValue: Boolean);
153
procedure SetShowDefMacros(const AValue: Boolean);
154
procedure SetShowErrors(const AValue: Boolean);
155
procedure SetShowExecInfo(const AValue: Boolean);
156
procedure SetShowGenInfo(const AValue: Boolean);
157
procedure SetShowHints(const AValue: Boolean);
158
procedure SetShowHintsForSenderNotUsed(const AValue: Boolean);
159
procedure SetShowHintsForUnusedUnitsInMainSrc(const AValue: Boolean);
160
procedure SetShowLineNum(const AValue: Boolean);
161
procedure SetShowNotes(const AValue: Boolean);
162
procedure SetShowNothing(const AValue: Boolean);
163
procedure SetShowSummary(const AValue: Boolean);
164
procedure SetShowTriedFiles(const AValue: Boolean);
165
procedure SetShowUsedFiles(const AValue: Boolean);
166
procedure SetShowWarn(const AValue: Boolean);
167
procedure SetSmallerCode(const AValue: boolean);
168
procedure SetSmartLinkUnit(const AValue: Boolean);
169
procedure SetStackChecks(const AValue: Boolean);
170
procedure SetStaticKeyword(const AValue: Boolean);
171
procedure SetStopAfterErrCount(const AValue: integer);
172
procedure SetStripSymbols(const AValue: Boolean);
173
procedure SetSyntaxMode(const AValue: string);
174
procedure SetTargetFilenameAppplyConventions(const AValue: boolean);
175
procedure SetUncertainOpt(const AValue: Boolean);
176
procedure SetUseAnsiStr(const AValue: Boolean);
177
procedure SetUseExternalDbgSyms(const AValue: Boolean);
178
procedure SetUseHeaptrc(const AValue: Boolean);
179
procedure SetUseLineInfoUnit(const AValue: Boolean);
180
procedure SetUseValgrind(const AValue: Boolean);
181
procedure SetVarsInReg(const AValue: Boolean);
182
procedure SetVerifyObjMethodCall(const AValue: boolean);
183
procedure SetWin32GraphicApp(const AValue: boolean);
184
procedure SetWriteFPCLogo(const AValue: Boolean);
187
FSavedChangeStamp: int64;
188
fOnChanged: TMethodList;
192
// conditionals / build modes
193
FConditionals: string;
194
fBuildMacros: TLazBuildMacros;
195
fLCLWidgetType: string;
199
fAssemblerStyle: Integer;
204
fIncludeAssertionCode: Boolean;
205
fAllowLabel: Boolean;
206
fUseAnsiStr: Boolean;
210
fStaticKeyword: Boolean;
213
fSmartLinkUnit: Boolean;
215
fRangeChecks: Boolean;
216
fOverflowChecks: Boolean;
217
fStackChecks: Boolean;
218
FEmulatedFloatOpcodes: boolean;
220
fVerifyObjMethodCall: boolean;
221
FSmallerCode: boolean;
225
fUncertainOpt: Boolean;
230
fGenDebugInfo: Boolean;
231
fUseLineInfoUnit: Boolean;
232
FGenerateDwarf: Boolean;
233
fUseHeaptrc: Boolean;
234
fUseValgrind: Boolean;
235
fGenGProfCode: Boolean;
236
fStripSymbols: Boolean;
238
fPassLinkerOpt: Boolean;
239
fLinkerOptions: String;
240
FWin32GraphicApp: boolean;
241
FExecutableType: TCompilationExecutableType;
242
FUseExternalDbgSyms : Boolean;
243
fTargetFilename: string;
244
FTargetFilenameAppplyConventions: boolean;
247
fShowErrors: Boolean;
251
fShowGenInfo: Boolean;
252
fShowLineNum: Boolean;
254
fShowAllProcsOnError: Boolean;
255
fShowDebugInfo: Boolean;
256
fShowUsedFiles: Boolean;
257
fShowTriedFiles: Boolean;
258
fShowDefMacros: Boolean;
259
fShowCompProc: Boolean;
261
fShowExecInfo: Boolean;
262
fShowNothing: Boolean;
263
fShowSummary: Boolean;
264
fShowHintsForUnusedUnitsInMainSrc: Boolean;
265
fShowHintsForSenderNotUsed: Boolean;
266
fWriteFPCLogo: Boolean;
267
fStopAfterErrCount: integer;
270
fDontUseConfigFile: Boolean;
271
fCustomConfigFile: Boolean;
272
fConfigFilePath: String;
274
function GetCustomOptions: string; virtual; abstract;
275
function GetDebugPath: string; virtual; abstract;
276
function GetIncludePaths: String; virtual; abstract;
277
function GetLibraryPaths: String; virtual; abstract;
278
function GetModified: boolean; virtual;
279
function GetObjectPath: string; virtual; abstract;
280
function GetSrcPath: string; virtual; abstract;
281
function GetUnitOutputDir: string; virtual; abstract;
282
function GetUnitPaths: String; virtual; abstract;
283
procedure SetCompilerPath(const AValue: String); virtual; abstract;
284
procedure SetConditionals(const AValue: string); virtual; abstract;
285
procedure SetCustomOptions(const AValue: string); virtual; abstract;
286
procedure SetDebugPath(const AValue: string); virtual; abstract;
287
procedure SetIncludePaths(const AValue: String); virtual; abstract;
288
procedure SetLibraryPaths(const AValue: String); virtual; abstract;
289
procedure SetLinkerOptions(const AValue: String); virtual; abstract;
290
procedure SetModified(const AValue: boolean); virtual; abstract;
291
procedure SetObjectPath(const AValue: string); virtual; abstract;
292
procedure SetSrcPath(const AValue: string); virtual; abstract;
293
procedure SetTargetCPU(const AValue: string); virtual; abstract;
294
procedure SetTargetFilename(const AValue: String); virtual; abstract;
295
procedure SetTargetOS(const AValue: string); virtual; abstract;
296
procedure SetTargetProc(const AValue: string); virtual; abstract;
297
procedure SetUnitOutputDir(const AValue: string); virtual; abstract;
298
procedure SetUnitPaths(const AValue: String); virtual; abstract;
299
procedure SetLCLWidgetType(const AValue: string); virtual;
301
constructor Create(const TheOwner: TObject); virtual;
302
destructor Destroy; override;
303
function IsActive: boolean; virtual;
304
function TrimCustomOptions(o: string): string; virtual; abstract;
306
property Owner: TObject read fOwner write fOwner;
307
property Modified: boolean read GetModified write SetModified;
308
property OnModified: TNotifyEvent read FOnModified write FOnModified;
309
property ChangeStamp: int64 read FChangeStamp;
310
procedure IncreaseChangeStamp;
311
class function InvalidChangeStamp: int64;
312
procedure AddOnChangedHandler(const Handler: TNotifyEvent);
313
procedure RemoveOnChangedHandler(const Handler: TNotifyEvent);
316
property IncludePath: String read GetIncludePaths write SetIncludePaths; // alias IncPath
317
property Libraries: String read GetLibraryPaths write SetLibraryPaths; // alias LibraryPath
318
property OtherUnitFiles: String read GetUnitPaths write SetUnitPaths; // alias UnitPath
319
property ObjectPath: string read GetObjectPath write SetObjectPath;
320
property SrcPath: string read GetSrcPath write SetSrcPath; // alias SrcPath
321
property DebugPath: string read GetDebugPath write SetDebugPath;
322
property UnitOutputDirectory: string read GetUnitOutputDir write SetUnitOutputDir;
324
// conditional / build modes
325
property Conditionals: string read FConditionals write SetConditionals;
326
property BuildMacros: TLazBuildMacros read fBuildMacros;
327
// Beware: eventually LCLWidgetType will be replaced by a more generic solution
328
property LCLWidgetType: string read fLCLWidgetType write SetLCLWidgetType;
331
property TargetFilename: String read fTargetFilename write SetTargetFilename;
332
property TargetFilenameAppplyConventions: boolean read FTargetFilenameAppplyConventions write SetTargetFilenameAppplyConventions;
335
property SyntaxMode: string read FSyntaxMode write SetSyntaxMode;
336
property AssemblerStyle: Integer read fAssemblerStyle write SetAssemblerStyle;
337
property CStyleOperators: Boolean read fCStyleOp write SetCStyleOp;
338
property IncludeAssertionCode: Boolean
339
read fIncludeAssertionCode write SetIncludeAssertionCode;
340
property AllowLabel: Boolean read fAllowLabel write SetAllowLabel;
341
property UseAnsiStrings: Boolean read fUseAnsiStr write SetUseAnsiStr;
342
property CPPInline: Boolean read fCPPInline write SetCPPInline;
343
property CStyleMacros: Boolean read fCMacros write SetCMacros;
344
property InitConstructor: Boolean read fInitConst write SetInitConst;
345
property StaticKeyword: Boolean read fStaticKeyword write SetStaticKeyword;
348
property IOChecks: Boolean read fIOChecks write SetIOChecks;
349
property RangeChecks: Boolean read fRangeChecks write SetRangeChecks;
350
property OverflowChecks: Boolean read fOverflowChecks write SetOverflowChecks;
351
property StackChecks: Boolean read fStackChecks write SetStackChecks;
352
property SmartLinkUnit: Boolean read fSmartLinkUnit write SetSmartLinkUnit;
353
property EmulatedFloatOpcodes: boolean read SetEmulatedFloatOpcodes
354
write SetEmulatedFloatOpcodes;
355
property HeapSize: Integer read fHeapSize write SetHeapSize;
356
property VerifyObjMethodCall: boolean read FVerifyObjMethodCall
357
write SetVerifyObjMethodCall;
358
property SmallerCode: boolean read FSmallerCode write SetSmallerCode;
359
property TargetCPU: string read fTargetCPU write SetTargetCPU; // general type
360
property TargetProcessor: String read fTargetProc write SetTargetProc; // specific
361
property TargetOS: string read fTargetOS write SetTargetOS;
362
property VariablesInRegisters: Boolean read fVarsInReg write SetVarsInReg;
363
property UncertainOptimizations: Boolean read fUncertainOpt write SetUncertainOpt;
364
property OptimizationLevel: Integer read fOptLevel write SetOptLevel;
367
property GenerateDebugInfo: Boolean read fGenDebugInfo write SetGenDebugInfo;
368
property UseLineInfoUnit: Boolean read fUseLineInfoUnit write SetUseLineInfoUnit;
369
property GenerateDwarf: Boolean read FGenerateDwarf write SetGenerateDwarf;
370
property UseHeaptrc: Boolean read fUseHeaptrc write SetUseHeaptrc;
371
property UseValgrind: Boolean read fUseValgrind write SetUseValgrind;
372
property GenGProfCode: Boolean read fGenGProfCode write SetGenGProfCode;
373
property StripSymbols: Boolean read fStripSymbols write SetStripSymbols;
374
property LinkSmart: Boolean read fLinkSmart write SetLinkSmart;
375
property PassLinkerOptions: Boolean read fPassLinkerOpt write SetPassLinkerOpt;
376
property LinkerOptions: String read fLinkerOptions write SetLinkerOptions;
377
property Win32GraphicApp: boolean read FWin32GraphicApp write SetWin32GraphicApp;
378
property ExecutableType: TCompilationExecutableType
379
read FExecutableType write SetExecutableType;
380
property UseExternalDbgSyms: Boolean read FUseExternalDbgSyms write SetUseExternalDbgSyms;
383
property ShowErrors: Boolean read fShowErrors write SetShowErrors;
384
property ShowWarn: Boolean read fShowWarn write SetShowWarn;
385
property ShowNotes: Boolean read fShowNotes write SetShowNotes;
386
property ShowHints: Boolean read fShowHints write SetShowHints;
387
property ShowGenInfo: Boolean read fShowGenInfo write SetShowGenInfo;
388
property ShowLineNum: Boolean read fShowLineNum write SetShowLineNum;
389
property ShowAll: Boolean read fShowAll write SetShowAll;
390
property ShowAllProcsOnError: Boolean
391
read fShowAllProcsOnError write SetShowAllProcsOnError;
392
property ShowDebugInfo: Boolean read fShowDebugInfo write SetShowDebugInfo;
393
property ShowUsedFiles: Boolean read fShowUsedFiles write SetShowUsedFiles;
394
property ShowTriedFiles: Boolean read fShowTriedFiles write SetShowTriedFiles;
395
property ShowDefMacros: Boolean read fShowDefMacros write SetShowDefMacros;
396
property ShowCompProc: Boolean read fShowCompProc write SetShowCompProc;
397
property ShowCond: Boolean read fShowCond write SetShowCond;
398
property ShowExecInfo: Boolean read fShowExecInfo write SetShowExecInfo;
399
property ShowNothing: Boolean read fShowNothing write SetShowNothing;
400
property ShowSummary: Boolean read FShowSummary write SetShowSummary;
401
property ShowHintsForUnusedUnitsInMainSrc: Boolean
402
read fShowHintsForUnusedUnitsInMainSrc write SetShowHintsForUnusedUnitsInMainSrc;
403
property ShowHintsForSenderNotUsed: Boolean
404
read fShowHintsForSenderNotUsed write SetShowHintsForSenderNotUsed;
405
property WriteFPCLogo: Boolean read fWriteFPCLogo write SetWriteFPCLogo;
406
property StopAfterErrCount: integer
407
read fStopAfterErrCount write SetStopAfterErrCount;
410
property DontUseConfigFile: Boolean read fDontUseConfigFile
411
write SetDontUseConfigFile;
412
property CustomConfigFile: Boolean read fCustomConfigFile
413
write SetCustomConfigFile;
414
property ConfigFilePath: String read fConfigFilePath write SetConfigFilePath;
415
property CustomOptions: string read GetCustomOptions write SetCustomOptions;
419
53
{ TLazProjectFile }
421
55
TLazProjectFile = class(TPersistent)
695
378
TLazProject = class(TAbstractIDEProjectOptions)
380
FCleanOutputFileMask: string;
381
FCleanSourcesFileMask: string;
697
382
FCustomData: TStringToStringTree;
698
383
FCustomSessionData: TStringToStringTree;
699
384
FExecutableType: TProjectExecutableType;
385
FFPDocPackageName: string;
700
386
fModified: boolean;
701
387
FProjectSessionFile: string;
702
388
FSessionModified: boolean;
704
390
FSessionStorage: TProjectSessionStorage;
705
FLazDocPaths: string;
706
procedure SetLazDocPaths(const AValue: string);
392
FUseAppBundle: Boolean;
393
procedure SetCleanOutputFileMask(const AValue: string);
394
procedure SetCleanSourcesFileMask(const AValue: string);
395
procedure SetFPDocPackageName(AValue: string);
396
procedure SetFPDocPaths(const AValue: string);
397
procedure SetUseAppBundle(AValue: Boolean);
708
399
FLazCompilerOptions: TLazCompilerOptions;
709
400
FFlags: TProjectFlags;
402
FRunParameters: TAbstractRunParamsOptions;
403
function GetFileCount: integer; virtual; abstract;
404
function GetFiles(Index: integer): TLazProjectFile; virtual; abstract;
710
405
function GetMainFile: TLazProjectFile; virtual; abstract;
711
406
function GetMainFileID: Integer; virtual; abstract;
407
function GetModified: boolean; virtual;
408
function GetProjectInfoFile: string; virtual; abstract;
409
function GetUseManifest: boolean; virtual; abstract;
410
procedure SetExecutableType(const AValue: TProjectExecutableType); virtual;
411
procedure SetFlags(const AValue: TProjectFlags); virtual;
712
412
procedure SetMainFileID(const AValue: Integer); virtual; abstract;
713
function GetFiles(Index: integer): TLazProjectFile; virtual; abstract;
714
procedure SetTitle(const AValue: String); virtual;
715
procedure SetFlags(const AValue: TProjectFlags); virtual;
716
function GetModified: boolean; virtual;
717
function GetProjectInfoFile: string; virtual; abstract;
413
procedure SetModified(const AValue: boolean); virtual;
718
414
procedure SetProjectInfoFile(const NewFilename: string); virtual; abstract;
719
415
procedure SetProjectSessionFile(const AValue: string); virtual;
416
procedure SetSessionModified(const AValue: boolean); virtual;
720
417
procedure SetSessionStorage(const AValue: TProjectSessionStorage); virtual;
721
procedure SetModified(const AValue: boolean); virtual;
722
procedure SetSessionModified(const AValue: boolean); virtual;
723
procedure SetExecutableType(const AValue: TProjectExecutableType); virtual;
418
procedure SetTitle(const AValue: String); virtual;
419
procedure SetUseManifest(AValue: boolean); virtual; abstract;
725
421
constructor Create(ProjectDescription: TProjectDescriptor); virtual;
726
422
destructor Destroy; override;
423
procedure Clear; virtual;
424
function IsVirtual: boolean; virtual; abstract;
727
425
function CreateProjectFile(const Filename: string
728
426
): TLazProjectFile; virtual; abstract;
729
427
procedure AddFile(ProjectFile: TLazProjectFile;
730
428
AddToProjectUsesClause: boolean); virtual; abstract;
731
429
procedure RemoveUnit(Index: integer; RemoveFromUsesSection: boolean = true); virtual; abstract;
732
function GetFileCount: integer; virtual; abstract;
733
430
procedure AddSrcPath(const SrcPathAddition: string); virtual; abstract;
734
431
procedure AddPackageDependency(const PackageName: string); virtual; abstract;
735
function ShortDescription: string;
736
432
procedure ClearModifieds(ClearUnits: boolean);
737
433
function FindFile(const AFilename: string;
738
434
SearchFlags: TProjectFileSearchFlags): TLazProjectFile; virtual; abstract;
739
435
procedure UpdateExecutableType; virtual; abstract;
740
procedure ShortenFilename(var AFilename: string); virtual; abstract;
741
procedure LongenFilename(var AFilename: string); virtual; abstract;
436
function GetShortFilename(const Filename: string; UseUp: boolean): string; virtual; abstract;
437
procedure ConvertToLPIFilename(var AFilename: string); virtual; abstract;
438
procedure ConvertFromLPIFilename(var AFilename: string); virtual; abstract;
439
procedure LoadDefaultIcon; virtual;
440
function GetFPDocPackageName: string;
441
function GetTitle: string; virtual; abstract; // Title with macros resolved
442
function GetDefaultTitle: string; // extract name from lpi file name
443
function GetTitleOrName: string; // GetTitle, if this is '' then GetDefaultTitle
444
function ShortDescription: string; deprecated; // since 0.9.31, use GetTitleOrName instead
743
446
property MainFileID: Integer read GetMainFileID write SetMainFileID;
744
447
property Files[Index: integer]: TLazProjectFile read GetFiles;
1413
1214
inherited Destroy;
1416
{ TLazCompilerOptions }
1418
procedure TLazCompilerOptions.SetLCLWidgetType(const AValue: string);
1420
if AValue=LCLWidgetType then exit;
1421
fLCLWidgetType:=AValue;
1422
IncreaseChangeStamp;
1425
procedure TLazCompilerOptions.SetLinkSmart(const AValue: Boolean);
1427
if fLinkSmart=AValue then exit;
1429
IncreaseChangeStamp;
1432
procedure TLazCompilerOptions.SetOptLevel(const AValue: Integer);
1434
if fOptLevel=AValue then exit;
1436
IncreaseChangeStamp;
1439
procedure TLazCompilerOptions.SetOverflowChecks(const AValue: Boolean);
1441
if fOverflowChecks=AValue then exit;
1442
fOverflowChecks:=AValue;
1443
IncreaseChangeStamp;
1446
procedure TLazCompilerOptions.SetPassLinkerOpt(const AValue: Boolean);
1448
if fPassLinkerOpt=AValue then exit;
1449
fPassLinkerOpt:=AValue;
1450
IncreaseChangeStamp;
1453
procedure TLazCompilerOptions.SetRangeChecks(const AValue: Boolean);
1455
if fRangeChecks=AValue then exit;
1456
fRangeChecks:=AValue;
1457
IncreaseChangeStamp;
1460
procedure TLazCompilerOptions.SetShowAll(const AValue: Boolean);
1462
if fShowAll=AValue then exit;
1464
IncreaseChangeStamp;
1467
procedure TLazCompilerOptions.SetShowAllProcsOnError(const AValue: Boolean);
1469
if fShowAllProcsOnError=AValue then exit;
1470
fShowAllProcsOnError:=AValue;
1471
IncreaseChangeStamp;
1474
procedure TLazCompilerOptions.SetShowCompProc(const AValue: Boolean);
1476
if fShowCompProc=AValue then exit;
1477
fShowCompProc:=AValue;
1478
IncreaseChangeStamp;
1481
procedure TLazCompilerOptions.SetShowCond(const AValue: Boolean);
1483
if fShowCond=AValue then exit;
1485
IncreaseChangeStamp;
1488
procedure TLazCompilerOptions.SetShowDebugInfo(const AValue: Boolean);
1490
if fShowDebugInfo=AValue then exit;
1491
fShowDebugInfo:=AValue;
1492
IncreaseChangeStamp;
1495
procedure TLazCompilerOptions.SetShowDefMacros(const AValue: Boolean);
1497
if fShowDefMacros=AValue then exit;
1498
fShowDefMacros:=AValue;
1499
IncreaseChangeStamp;
1502
procedure TLazCompilerOptions.SetShowErrors(const AValue: Boolean);
1504
if fShowErrors=AValue then exit;
1505
fShowErrors:=AValue;
1506
IncreaseChangeStamp;
1509
procedure TLazCompilerOptions.SetShowExecInfo(const AValue: Boolean);
1511
if fShowExecInfo=AValue then exit;
1512
fShowExecInfo:=AValue;
1513
IncreaseChangeStamp;
1516
procedure TLazCompilerOptions.SetShowGenInfo(const AValue: Boolean);
1518
if fShowGenInfo=AValue then exit;
1519
fShowGenInfo:=AValue;
1520
IncreaseChangeStamp;
1523
procedure TLazCompilerOptions.SetShowHints(const AValue: Boolean);
1525
if fShowHints=AValue then exit;
1527
IncreaseChangeStamp;
1530
procedure TLazCompilerOptions.SetShowHintsForSenderNotUsed(const AValue: Boolean
1533
if fShowHintsForSenderNotUsed=AValue then exit;
1534
fShowHintsForSenderNotUsed:=AValue;
1535
IncreaseChangeStamp;
1538
procedure TLazCompilerOptions.SetShowHintsForUnusedUnitsInMainSrc(
1539
const AValue: Boolean);
1541
if fShowHintsForUnusedUnitsInMainSrc=AValue then exit;
1542
fShowHintsForUnusedUnitsInMainSrc:=AValue;
1543
IncreaseChangeStamp;
1546
procedure TLazCompilerOptions.SetShowLineNum(const AValue: Boolean);
1548
if fShowLineNum=AValue then exit;
1549
fShowLineNum:=AValue;
1550
IncreaseChangeStamp;
1553
procedure TLazCompilerOptions.SetShowNotes(const AValue: Boolean);
1555
if fShowNotes=AValue then exit;
1557
IncreaseChangeStamp;
1560
procedure TLazCompilerOptions.SetShowNothing(const AValue: Boolean);
1562
if fShowNothing=AValue then exit;
1563
fShowNothing:=AValue;
1564
IncreaseChangeStamp;
1567
procedure TLazCompilerOptions.SetShowSummary(const AValue: Boolean);
1569
if FShowSummary=AValue then exit;
1570
FShowSummary:=AValue;
1571
IncreaseChangeStamp;
1574
procedure TLazCompilerOptions.SetShowTriedFiles(const AValue: Boolean);
1576
if fShowTriedFiles=AValue then exit;
1577
fShowTriedFiles:=AValue;
1578
IncreaseChangeStamp;
1581
procedure TLazCompilerOptions.SetShowUsedFiles(const AValue: Boolean);
1583
if fShowUsedFiles=AValue then exit;
1584
fShowUsedFiles:=AValue;
1585
IncreaseChangeStamp;
1588
procedure TLazCompilerOptions.SetShowWarn(const AValue: Boolean);
1590
if fShowWarn=AValue then exit;
1592
IncreaseChangeStamp;
1595
procedure TLazCompilerOptions.SetSmallerCode(const AValue: boolean);
1597
if FSmallerCode=AValue then exit;
1598
FSmallerCode:=AValue;
1599
IncreaseChangeStamp;
1602
procedure TLazCompilerOptions.SetSmartLinkUnit(const AValue: Boolean);
1604
if fSmartLinkUnit=AValue then exit;
1605
fSmartLinkUnit:=AValue;
1606
IncreaseChangeStamp;
1609
procedure TLazCompilerOptions.SetStackChecks(const AValue: Boolean);
1611
if fStackChecks=AValue then exit;
1612
fStackChecks:=AValue;
1613
IncreaseChangeStamp;
1616
procedure TLazCompilerOptions.SetAllowLabel(const AValue: Boolean);
1618
if fAllowLabel=AValue then exit;
1619
fAllowLabel:=AValue;
1620
IncreaseChangeStamp;
1623
procedure TLazCompilerOptions.SetAssemblerStyle(const AValue: Integer);
1625
if fAssemblerStyle=AValue then exit;
1626
fAssemblerStyle:=AValue;
1627
IncreaseChangeStamp;
1630
procedure TLazCompilerOptions.SetCMacros(const AValue: Boolean);
1632
if fCMacros=AValue then exit;
1634
IncreaseChangeStamp;
1637
procedure TLazCompilerOptions.SetConfigFilePath(const AValue: String);
1639
if fConfigFilePath=AValue then exit;
1640
fConfigFilePath:=AValue;
1641
IncreaseChangeStamp;
1644
procedure TLazCompilerOptions.SetCPPInline(const AValue: Boolean);
1646
if fCPPInline=AValue then exit;
1648
IncreaseChangeStamp;
1651
procedure TLazCompilerOptions.SetCStyleOp(const AValue: Boolean);
1653
if fCStyleOp=AValue then exit;
1655
IncreaseChangeStamp;
1658
procedure TLazCompilerOptions.SetCustomConfigFile(const AValue: Boolean);
1660
if fCustomConfigFile=AValue then exit;
1661
fCustomConfigFile:=AValue;
1662
IncreaseChangeStamp;
1665
procedure TLazCompilerOptions.SetDontUseConfigFile(const AValue: Boolean);
1667
if fDontUseConfigFile=AValue then exit;
1668
fDontUseConfigFile:=AValue;
1669
IncreaseChangeStamp;
1672
procedure TLazCompilerOptions.SetExecutableType(
1673
const AValue: TCompilationExecutableType);
1675
if FExecutableType=AValue then exit;
1676
FExecutableType:=AValue;
1677
IncreaseChangeStamp;
1680
procedure TLazCompilerOptions.SetGenDebugInfo(const AValue: Boolean);
1682
if fGenDebugInfo=AValue then exit;
1683
fGenDebugInfo:=AValue;
1684
IncreaseChangeStamp;
1687
procedure TLazCompilerOptions.SetGenerateDwarf(const AValue: Boolean);
1689
if FGenerateDwarf=AValue then exit;
1690
FGenerateDwarf:=AValue;
1691
IncreaseChangeStamp;
1694
procedure TLazCompilerOptions.SetGenGProfCode(const AValue: Boolean);
1696
if fGenGProfCode=AValue then exit;
1697
fGenGProfCode:=AValue;
1698
IncreaseChangeStamp;
1701
procedure TLazCompilerOptions.SetHeapSize(const AValue: Integer);
1703
if fHeapSize=AValue then exit;
1705
IncreaseChangeStamp;
1708
procedure TLazCompilerOptions.SetIncludeAssertionCode(const AValue: Boolean);
1710
if fIncludeAssertionCode=AValue then exit;
1711
fIncludeAssertionCode:=AValue;
1712
IncreaseChangeStamp;
1715
procedure TLazCompilerOptions.SetInitConst(const AValue: Boolean);
1717
if fInitConst=AValue then exit;
1719
IncreaseChangeStamp;
1722
procedure TLazCompilerOptions.SetIOChecks(const AValue: Boolean);
1724
if fIOChecks=AValue then exit;
1726
IncreaseChangeStamp;
1729
procedure TLazCompilerOptions.SetStaticKeyword(const AValue: Boolean);
1731
if fStaticKeyword=AValue then exit;
1732
fStaticKeyword:=AValue;
1733
IncreaseChangeStamp;
1736
procedure TLazCompilerOptions.SetStopAfterErrCount(const AValue: integer);
1738
if fStopAfterErrCount=AValue then exit;
1739
fStopAfterErrCount:=AValue;
1740
IncreaseChangeStamp;
1743
procedure TLazCompilerOptions.SetStripSymbols(const AValue: Boolean);
1745
if fStripSymbols=AValue then exit;
1746
fStripSymbols:=AValue;
1747
IncreaseChangeStamp;
1750
procedure TLazCompilerOptions.SetSyntaxMode(const AValue: string);
1752
if FSyntaxMode=AValue then exit;
1753
FSyntaxMode:=AValue;
1754
IncreaseChangeStamp;
1757
procedure TLazCompilerOptions.SetTargetFilenameAppplyConventions(
1758
const AValue: boolean);
1760
if FTargetFilenameAppplyConventions=AValue then exit;
1761
FTargetFilenameAppplyConventions:=AValue;
1762
IncreaseChangeStamp;
1765
procedure TLazCompilerOptions.SetUncertainOpt(const AValue: Boolean);
1767
if fUncertainOpt=AValue then exit;
1768
fUncertainOpt:=AValue;
1769
IncreaseChangeStamp;
1772
procedure TLazCompilerOptions.SetUseAnsiStr(const AValue: Boolean);
1774
if fUseAnsiStr=AValue then exit;
1775
fUseAnsiStr:=AValue;
1776
IncreaseChangeStamp;
1779
procedure TLazCompilerOptions.SetUseExternalDbgSyms(const AValue: Boolean);
1781
if FUseExternalDbgSyms=AValue then exit;
1782
FUseExternalDbgSyms:=AValue;
1783
IncreaseChangeStamp;
1786
procedure TLazCompilerOptions.SetUseHeaptrc(const AValue: Boolean);
1788
if fUseHeaptrc=AValue then exit;
1789
fUseHeaptrc:=AValue;
1790
IncreaseChangeStamp;
1793
procedure TLazCompilerOptions.SetUseLineInfoUnit(const AValue: Boolean);
1795
if fUseLineInfoUnit=AValue then exit;
1796
fUseLineInfoUnit:=AValue;
1797
IncreaseChangeStamp;
1800
procedure TLazCompilerOptions.SetUseValgrind(const AValue: Boolean);
1802
if fUseValgrind=AValue then exit;
1803
fUseValgrind:=AValue;
1804
IncreaseChangeStamp;
1807
procedure TLazCompilerOptions.SetVarsInReg(const AValue: Boolean);
1809
if fVarsInReg=AValue then exit;
1811
IncreaseChangeStamp;
1814
procedure TLazCompilerOptions.SetVerifyObjMethodCall(const AValue: boolean);
1816
if FVerifyObjMethodCall=AValue then exit;
1817
FVerifyObjMethodCall:=AValue;
1818
IncreaseChangeStamp;
1821
procedure TLazCompilerOptions.SetWin32GraphicApp(const AValue: boolean);
1823
if FWin32GraphicApp=AValue then exit;
1824
FWin32GraphicApp:=AValue;
1825
IncreaseChangeStamp;
1828
procedure TLazCompilerOptions.SetWriteFPCLogo(const AValue: Boolean);
1830
if fWriteFPCLogo=AValue then exit;
1831
fWriteFPCLogo:=AValue;
1832
IncreaseChangeStamp;
1835
function TLazCompilerOptions.GetModified: boolean;
1837
Result:=(FSavedChangeStamp=InvalidChangeStamp)
1838
or (FSavedChangeStamp<>FChangeStamp);
1841
constructor TLazCompilerOptions.Create(const TheOwner: TObject);
1844
fOnChanged:=TMethodList.Create;
1845
FChangeStamp:=InvalidChangeStamp;
1846
FSavedChangeStamp:=FChangeStamp;
1847
FTargetFilenameAppplyConventions:=true;
1851
destructor TLazCompilerOptions.Destroy;
1853
FreeAndNil(fOnChanged);
1857
function TLazCompilerOptions.IsActive: boolean;
1862
procedure TLazCompilerOptions.IncreaseChangeStamp;
1864
if fChangeStamp<High(ChangeStamp) then
1867
fChangeStamp:=Low(int64)+1;
1868
if fOnChanged<>nil then fOnChanged.CallNotifyEvents(Self);
1871
class function TLazCompilerOptions.InvalidChangeStamp: int64;
1876
procedure TLazCompilerOptions.AddOnChangedHandler(const Handler: TNotifyEvent);
1878
fOnChanged.Add(TMethod(Handler));
1881
procedure TLazCompilerOptions.RemoveOnChangedHandler(const Handler: TNotifyEvent
1884
fOnChanged.Remove(TMethod(Handler));
1887
1217
{ TNewItemProjectFile }
1889
1219
function TNewItemProjectFile.LocalizedName: string;