IDE: use user compiler options only when project decsriptor allows

git-svn-id: trunk@23195 -
This commit is contained in:
mattias 2009-12-19 10:50:36 +00:00
parent fd5085297e
commit 0fff58e158
3 changed files with 15 additions and 7 deletions

View File

@ -8951,7 +8951,8 @@ begin
Project1.BeginUpdate(true);
try
Project1.CompilerOptions.CompilerPath:='$(CompPath)';
DoLoadDefaultCompilerOptions(Project1);
if pfUseDefaultCompilerOptions in Project1.Flags then
DoLoadDefaultCompilerOptions(Project1);
Project1.AutoAddOutputDirToIncPath;
UpdateCaption;
if ProjInspector<>nil then ProjInspector.LazProject:=Project1;

View File

@ -5435,7 +5435,8 @@ constructor TProjectProgramDescriptor.Create;
begin
inherited Create;
Name:=ProjDescNameProgram;
Flags:=Flags-[pfMainUnitHasCreateFormStatements,pfMainUnitHasTitleStatement];
Flags:=Flags-[pfMainUnitHasCreateFormStatements,pfMainUnitHasTitleStatement]
+[pfUseDefaultCompilerOptions];
end;
function TProjectProgramDescriptor.GetLocalizedName: string;
@ -5497,6 +5498,7 @@ constructor TProjectApplicationDescriptor.Create;
begin
inherited Create;
Name:=ProjDescNameApplication;
Flags:=Flags+[pfUseDefaultCompilerOptions];
end;
function TProjectApplicationDescriptor.GetLocalizedName: string;
@ -5567,7 +5569,8 @@ begin
Name:=ProjDescNameCustomProgram;
Flags:=Flags-[pfMainUnitHasUsesSectionForAllUnits,
pfMainUnitHasCreateFormStatements,
pfMainUnitHasTitleStatement];
pfMainUnitHasTitleStatement]
+[pfUseDefaultCompilerOptions];
FAddMainSource:=true;
end;
@ -5635,7 +5638,8 @@ constructor TProjectLibraryDescriptor.Create;
begin
inherited Create;
Name:=ProjDescNameLibrary;
Flags:=Flags-[pfMainUnitHasCreateFormStatements,pfMainUnitHasTitleStatement];
Flags:=Flags-[pfMainUnitHasCreateFormStatements,pfMainUnitHasTitleStatement]
+[pfUseDefaultCompilerOptions];
end;
function TProjectLibraryDescriptor.GetLocalizedName: string;
@ -5857,7 +5861,8 @@ constructor TProjectConsoleApplicationDescriptor.Create;
begin
inherited Create;
Name:=ProjDescNameConsoleApplication;
Flags:=Flags-[pfMainUnitHasCreateFormStatements,pfMainUnitHasTitleStatement];
Flags:=Flags-[pfMainUnitHasCreateFormStatements,pfMainUnitHasTitleStatement]
+[pfUseDefaultCompilerOptions];
end;
function TProjectConsoleApplicationDescriptor.GetLocalizedName: string;

View File

@ -629,7 +629,8 @@ type
pfMainUnitHasTitleStatement,// add/remove Application.Title:= statements
pfRunnable, // project can be run
pfAlwaysBuild, // skip IDE's smart check if compilation is needed and always compile
pfLRSFilesInOutputDirectory // put .lrs files in output directory
pfLRSFilesInOutputDirectory, // put .lrs files in output directory
pfUseDefaultCompilerOptions // load users default compiler options
);
TProjectFlags = set of TProjectFlag;
@ -833,7 +834,8 @@ const
'MainUnitHasTitleStatement',
'Runnable',
'AlwaysBuild',
'LRSInOutputDirectory'
'LRSInOutputDirectory',
'UseDefaultCompilerOptions'
);
ProjectSessionStorageNames: array[TProjectSessionStorage] of string = (