mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-07 11:57:15 +01:00
IDE: darwin: fixed run without debug and UseAppBundle, bug #31597
git-svn-id: trunk@54482 -
This commit is contained in:
parent
f1d9980865
commit
abd99ffb35
@ -584,7 +584,7 @@ end;
|
||||
|
||||
function TBuildManager.GetRunCommandLine: string;
|
||||
var
|
||||
TFN: string; // Target Filename
|
||||
TargetFilename: string;
|
||||
begin
|
||||
Result := '';
|
||||
if Project1=nil then exit;
|
||||
@ -596,14 +596,16 @@ begin
|
||||
Result := Project1.RunParameterOptions.CmdLineParams;
|
||||
if GlobalMacroList.SubstituteStr(Result) then
|
||||
begin
|
||||
TFN := GetTargetFilename;
|
||||
if (TFN <> '') and (TFN[Length(TFN)] in AllowDirectorySeparators) then
|
||||
TFN += ExtractFileNameOnly(Project1.CompilerOptions.GetDefaultMainSourceFileName);
|
||||
TFN := '"'+TFN+'"';
|
||||
TargetFilename := GetTargetFilename;
|
||||
if (TargetFilename <> '')
|
||||
and (TargetFilename[Length(TargetFilename)] in AllowDirectorySeparators) then
|
||||
TargetFilename += ExtractFileNameOnly(
|
||||
Project1.CompilerOptions.GetDefaultMainSourceFileName);
|
||||
TargetFilename := '"'+TargetFilename+'"';
|
||||
if Result='' then
|
||||
Result:=TFN
|
||||
Result:=TargetFilename
|
||||
else
|
||||
Result:=TFN+' '+Result;
|
||||
Result:=TargetFilename+' '+Result;
|
||||
end else
|
||||
Result:='';
|
||||
end else begin
|
||||
|
||||
21
ide/main.pp
21
ide/main.pp
@ -7041,6 +7041,7 @@ var
|
||||
Process: TProcessUTF8;
|
||||
ExeCmdLine, ExeWorkingDirectory: string;
|
||||
ExeFileEnd, ExeFileStart: Integer;
|
||||
RunAppBundle: Boolean;
|
||||
begin
|
||||
debugln(['TMainIDE.DoRunProjectWithoutDebug START']);
|
||||
if Project1=nil then
|
||||
@ -7060,8 +7061,10 @@ begin
|
||||
end;
|
||||
|
||||
Process := TProcessUTF8.Create(nil);
|
||||
|
||||
try
|
||||
RunAppBundle:={$IFDEF Darwin}true{$ELSE}false{$ENDIF};
|
||||
RunAppBundle:=RunAppBundle and Project1.UseAppBundle;
|
||||
|
||||
if ExeCmdLine[1]='"' then
|
||||
begin
|
||||
ExeFileStart := 2;
|
||||
@ -7076,7 +7079,13 @@ begin
|
||||
|
||||
Process.Executable := Copy(ExeCmdLine, ExeFileStart, ExeFileEnd-ExeFileStart);
|
||||
Process.Parameters.Text := Copy(ExeCmdLine, ExeFileEnd+ExeFileStart, High(Integer));
|
||||
if not FileIsExecutable(Process.Executable) then
|
||||
|
||||
if RunAppBundle and FileExistsUTF8(Process.Executable)
|
||||
and FileExistsUTF8('/usr/bin/open') then
|
||||
begin
|
||||
Process.Parameters.Insert(0,Process.Executable);
|
||||
Process.Executable := '/usr/bin/open';
|
||||
end else if not FileIsExecutable(Process.Executable) then
|
||||
begin
|
||||
if Project1.RunParameterOptions.UseLaunchingApplication then
|
||||
IDEMessageDialog(lisLaunchingApplicationInvalid,
|
||||
@ -7107,14 +7116,6 @@ begin
|
||||
Exit(mrNone);
|
||||
end;
|
||||
|
||||
{$ifdef darwin}
|
||||
if Project1.UseAppBundle then
|
||||
begin
|
||||
Process.Parameters.Insert(0,Process.Executable);
|
||||
Process.Executable := '/usr/bin/open';
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
Process.Execute;
|
||||
finally
|
||||
Process.Free;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user