mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 23:00:27 +02:00
fixed search path to cmd line param
git-svn-id: trunk@6673 -
This commit is contained in:
parent
439830118d
commit
f7d46bbd2e
@ -504,47 +504,31 @@ begin
|
||||
end;
|
||||
|
||||
function ConvertSearchPathToCmdLine(
|
||||
const switch, paths: String): String;
|
||||
const Switch, Paths: String): String;
|
||||
var
|
||||
tempsw, SS, Delim: String;
|
||||
M: Integer;
|
||||
StartPos: Integer;
|
||||
l: Integer;
|
||||
EndPos: LongInt;
|
||||
begin
|
||||
Delim := ';';
|
||||
if Switch='' then
|
||||
RaiseException('ConvertSearchPathToCmdLine no Switch');
|
||||
Result := '';
|
||||
if (Paths = '') then exit;
|
||||
|
||||
if (switch = '') or (paths = '') then
|
||||
begin
|
||||
Result := '';
|
||||
Exit;
|
||||
end;
|
||||
|
||||
tempsw := '';
|
||||
SS := paths;
|
||||
|
||||
repeat
|
||||
M := Pos (Delim, SS);
|
||||
|
||||
if (M = 0) then
|
||||
begin
|
||||
if (tempsw <> '') then
|
||||
tempsw := tempsw + ' ';
|
||||
tempsw := tempsw + PrepareCmdLineOption(switch + SS);
|
||||
Break;
|
||||
end
|
||||
else if (M = 1) then
|
||||
begin
|
||||
SS := Copy (SS, M + 1, Length(SS));
|
||||
Continue;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if (tempsw <> '') then
|
||||
tempsw := tempsw + ' ';
|
||||
tempsw := tempsw + PrepareCmdLineOption(switch + Copy (SS, 1, M - 1));
|
||||
SS := Copy (SS, M + 1, Length(SS));
|
||||
l:=length(Paths);
|
||||
StartPos:=1;
|
||||
while StartPos<=l do begin
|
||||
while (StartPos<=l) and (Paths[StartPos]=' ') do inc(StartPos);
|
||||
EndPos:=StartPos;
|
||||
while (EndPos<=l) and (Paths[EndPos]<>';') do inc(EndPos);
|
||||
if StartPos<EndPos then begin
|
||||
if Result<>'' then
|
||||
Result:=Result+' ';
|
||||
Result:=Result
|
||||
+PrepareCmdLineOption(Switch + copy(Paths,StartPos,EndPos-StartPos));
|
||||
end;
|
||||
until (SS = '') or (M = 0);
|
||||
|
||||
Result := tempsw;
|
||||
StartPos:=EndPos+1;
|
||||
end;
|
||||
end;
|
||||
|
||||
function ConvertOptionsToCmdLine(const Delim, Switch,
|
||||
@ -1249,13 +1233,22 @@ var
|
||||
begin
|
||||
// current path
|
||||
CurrentPath:=ParsedOpts.GetParsedValue(Option);
|
||||
//if Option=pcosUnitPath then
|
||||
// debugln('TBaseCompilerOptions.GetParsedPath GetParsedValue ',dbgsName(Self),' RelativeToBaseDir=',dbgs(RelativeToBaseDir),' CurrentPath="',CurrentPath,'"');
|
||||
|
||||
if (not RelativeToBaseDir) then
|
||||
CreateAbsolutePath(CurrentPath,BaseDirectory);
|
||||
//if Option=pcosUnitPath then
|
||||
// debugln('TBaseCompilerOptions.GetParsedPath CreateAbsolutePath ',dbgsName(Self),' CurrentPath="',CurrentPath,'"');
|
||||
|
||||
// inherited path
|
||||
InheritedPath:=GetInheritedOption(InheritedOption,RelativeToBaseDir);
|
||||
//if Option=pcosUnitPath then
|
||||
// debugln('TBaseCompilerOptions.GetParsedPath Inherited ',dbgsName(Self),' InheritedPath="',InheritedPath,'"');
|
||||
|
||||
Result:=MergeSearchPaths(CurrentPath,InheritedPath);
|
||||
//if Option=pcosUnitPath then
|
||||
// debugln('TBaseCompilerOptions.GetParsedPath Total ',dbgsName(Self),' CurrentPath="',CurrentPath,'"');
|
||||
end;
|
||||
|
||||
function TBaseCompilerOptions.GetCustomOptions: string;
|
||||
@ -1774,6 +1767,7 @@ Processor specific options:
|
||||
|
||||
// unit path
|
||||
CurUnitPath:=GetUnitPath(true);
|
||||
debugln('TBaseCompilerOptions.MakeOptionsString A ',dbgsName(Self),' CurUnitPath="',CurUnitPath,'"');
|
||||
// always add the current directory to the unit path, so that the compiler
|
||||
// checks for changed files in the directory
|
||||
CurUnitPath:=CurUnitPath+';.';
|
||||
|
@ -462,7 +462,7 @@ begin
|
||||
PutCompilerOptions(true);
|
||||
CurOptions := CompilerOpts.MakeOptionsString(nil,
|
||||
CompilerOpts.DefaultMakeOptionsFlags);
|
||||
DebugLn('CompilerOpts.MakeOptionsString: ' + CurOptions);
|
||||
//DebugLn('CompilerOpts.MakeOptionsString: ' + CurOptions);
|
||||
ShowCompilerOptionsDialog(CurOptions);
|
||||
end;
|
||||
|
||||
|
@ -505,6 +505,9 @@ resourcestring
|
||||
+'unit with the name %s%s%s. Pascal identifiers must be unique.';
|
||||
lisSeeMessages = 'See messages.';
|
||||
lisError = 'Error: ';
|
||||
lisSaveChanges = 'Save changes?';
|
||||
lisSaveFileBeforeClosingForm =
|
||||
'Save file %s%s%s%sbefore closing form %s%s%s?';
|
||||
lisUnableToRenameFormInSource = 'Unable to rename form in source.';
|
||||
lisSorryNotImplementedYet = 'Sorry, not implemented yet';
|
||||
lisUnableToFindMethodPlzFixTheErrorShownInTheMessage = 'Unable to find '
|
||||
|
10
ide/main.pp
10
ide/main.pp
@ -10375,9 +10375,10 @@ begin
|
||||
GetDesignerUnit(ADesigner,ASrcEdit,AnUnitInfo);
|
||||
if AnUnitInfo.NeedsSaveToDisk
|
||||
then begin
|
||||
case MessageDlg('Save changes?',
|
||||
'Save file "'+AnUnitInfo.Filename+'"'#13
|
||||
+'before closing form "'+ADesigner.LookupRoot.Name+'"?',
|
||||
case MessageDlg(lisSaveChanges,
|
||||
Format(lisSaveFileBeforeClosingForm, ['"',
|
||||
AnUnitInfo.Filename, '"', #13, '"',
|
||||
ADesigner.LookupRoot.Name, '"']),
|
||||
mtConfirmation,[mbYes,mbNo,mbCancel],0) of
|
||||
mrYes: begin
|
||||
if DoSaveEditorFile(AnUnitInfo.EditorIndex,[sfCheckAmbigiousFiles])<>mrOk
|
||||
@ -11377,6 +11378,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.837 2005/01/24 02:42:34 mattias
|
||||
fixed search path to cmd line param
|
||||
|
||||
Revision 1.836 2005/01/21 22:08:11 micha
|
||||
implement restored size, let lazarus ide store restored size
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user