mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 20:10:20 +02:00
ide: run working directory: use exe folder and as fallback the project directory
This commit is contained in:
parent
9f62dd37a3
commit
b38b88bdb5
@ -717,6 +717,7 @@ begin
|
||||
Result := '';
|
||||
if Project1=nil then exit;
|
||||
|
||||
// first take the WorkDir from the active run parameters
|
||||
AMode := Project1.RunParameterOptions.GetActiveMode;
|
||||
if AMode<>nil then
|
||||
Result := AMode.WorkingDirectory;
|
||||
@ -725,14 +726,16 @@ begin
|
||||
if (Result <> '') and not FilenameIsAbsolute(Result) then
|
||||
Result := CreateAbsolutePath(Result, Project1.Directory);
|
||||
|
||||
if (Result='') and (not Project1.IsVirtual) then
|
||||
Result := ChompPathDelim(Project1.Directory);
|
||||
|
||||
// then use the directory of the produced exe
|
||||
if Result='' then begin
|
||||
Result := ExtractFilePath(BuildBoss.GetProjectTargetFilename(Project1));
|
||||
if (Result <> '') and not FilenameIsAbsolute(Result) then
|
||||
Result := CreateAbsolutePath(Result, Project1.Directory);
|
||||
end;
|
||||
|
||||
// finally use the project directory
|
||||
if (Result='') and (not Project1.IsVirtual) then
|
||||
Result := ChompPathDelim(Project1.Directory);
|
||||
end;
|
||||
|
||||
procedure TBuildManager.WriteDebug_RunCommandLine;
|
||||
|
Loading…
Reference in New Issue
Block a user