mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-21 22:59:27 +02:00
ide: run working directory: use exe folder and as fallback the project directory
(cherry picked from commit b38b88bdb5
)
This commit is contained in:
parent
023766bdda
commit
c4c2c20f7c
@ -698,6 +698,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;
|
||||
@ -706,14 +707,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