You've already forked lazarus-ccr
iphonelazext: update the package to allow non OSX platform compilation
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4414 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -19,7 +19,7 @@ unit ideext;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Unix, BaseUnix, process,
|
process,
|
||||||
Classes, SysUtils, contnrs,
|
Classes, SysUtils, contnrs,
|
||||||
Graphics, Controls, Forms, Dialogs, LazFileUtils,
|
Graphics, Controls, Forms, Dialogs, LazFileUtils,
|
||||||
{Lazarus Interface}
|
{Lazarus Interface}
|
||||||
@ -46,7 +46,7 @@ type
|
|||||||
TiPhoneExtension = class(TObject)
|
TiPhoneExtension = class(TObject)
|
||||||
protected
|
protected
|
||||||
procedure FillBunldeInfo(forSimulator: Boolean; var info: TiPhoneBundleInfo);
|
procedure FillBunldeInfo(forSimulator: Boolean; var info: TiPhoneBundleInfo);
|
||||||
procedure InstallAppToSim;
|
procedure InstallAppToSim; deprecated 'use iphonesimctrl unit routines instead';
|
||||||
function FixCustomOptions(const Options: String; isRealDevice: Boolean): String;
|
function FixCustomOptions(const Options: String; isRealDevice: Boolean): String;
|
||||||
|
|
||||||
function WriteIconTo(const FullName: String): Boolean;
|
function WriteIconTo(const FullName: String): Boolean;
|
||||||
@ -58,7 +58,9 @@ type
|
|||||||
function GetXcodeProjDirName: string;
|
function GetXcodeProjDirName: string;
|
||||||
public
|
public
|
||||||
SimPID : Integer;
|
SimPID : Integer;
|
||||||
|
{$ifdef darwin}
|
||||||
SimLogger : TPTYReader;
|
SimLogger : TPTYReader;
|
||||||
|
{$endif}
|
||||||
constructor Create;
|
constructor Create;
|
||||||
procedure UpdateXcode(Sender: TObject);
|
procedure UpdateXcode(Sender: TObject);
|
||||||
procedure SimRun(Sender: TObject);
|
procedure SimRun(Sender: TObject);
|
||||||
@ -151,8 +153,10 @@ begin
|
|||||||
|
|
||||||
if nm<>'' then begin
|
if nm<>'' then begin
|
||||||
dstpath:=UTF8Encode(exepath);
|
dstpath:=UTF8Encode(exepath);
|
||||||
|
{$ifdef darwin}
|
||||||
FpUnlink(dstpath);
|
FpUnlink(dstpath);
|
||||||
fpSymlink(PChar(nm), PChar(dstpath));
|
fpSymlink(PChar(nm), PChar(dstpath));
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
xiblist := TStringList.Create;
|
xiblist := TStringList.Create;
|
||||||
@ -516,6 +520,9 @@ begin
|
|||||||
prj := GetXcodeProjDirName;
|
prj := GetXcodeProjDirName;
|
||||||
IDEMsg('Build+Install Xcode project (xcodebuild)');
|
IDEMsg('Build+Install Xcode project (xcodebuild)');
|
||||||
|
|
||||||
|
{$ifndef darwin}
|
||||||
|
IDEMsg('Unable to install / run simulator on non Mac OS X platform');
|
||||||
|
{$else}
|
||||||
if not InstallXcodePrj(prj, 'iphonesimulator', EnvOptions.DefaultDeviceID) then begin
|
if not InstallXcodePrj(prj, 'iphonesimulator', EnvOptions.DefaultDeviceID) then begin
|
||||||
IDEMsg('xcodebuild failed');
|
IDEMsg('xcodebuild failed');
|
||||||
Exit;
|
Exit;
|
||||||
@ -546,6 +553,7 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
IDEMsg('Success. Application pid='+IntToStr(pid));
|
IDEMsg('Success. Application pid='+IntToStr(pid));
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TiPhoneExtension.SimTerminate(Sender: TObject);
|
procedure TiPhoneExtension.SimTerminate(Sender: TObject);
|
||||||
@ -558,8 +566,10 @@ begin
|
|||||||
if SimPID>0 then begin
|
if SimPID>0 then begin
|
||||||
StopProc(SimPID);
|
StopProc(SimPID);
|
||||||
SimPID:=-1;
|
SimPID:=-1;
|
||||||
|
{$ifdef darwin}
|
||||||
SimLogger.Free;
|
SimLogger.Free;
|
||||||
SimLogger:=nil;
|
SimLogger:=nil;
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ begin
|
|||||||
RunCommand('xcrun', ['simctl', 'list', 'devices', '-j'], s);
|
RunCommand('xcrun', ['simctl', 'list', 'devices', '-j'], s);
|
||||||
try
|
try
|
||||||
dt:=nil;
|
dt:=nil;
|
||||||
j:=TJSONParser.Create(s, []);
|
j:=TJSONParser.Create(s);
|
||||||
try
|
try
|
||||||
dt:=j.Parse;
|
dt:=j.Parse;
|
||||||
finally
|
finally
|
||||||
|
@ -5,11 +5,15 @@ unit newXibDialog;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$ifdef lclcarbon}
|
||||||
MacOSAll,
|
MacOSAll,
|
||||||
|
{$endif}
|
||||||
Types,Classes,SysUtils,FileUtil,LResources,Forms,Controls,Graphics,Dialogs,StdCtrls,LCLProc,
|
Types,Classes,SysUtils,FileUtil,LResources,Forms,Controls,Graphics,Dialogs,StdCtrls,LCLProc,
|
||||||
Grids,
|
Grids
|
||||||
//todo: use LCL file loading and drawing, instead of OSX
|
//todo: use LCL file loading and drawing, instead of OSX
|
||||||
CarbonGDIObjects, CarbonProc;
|
{$ifdef lclcarbon}
|
||||||
|
,CarbonGDIObjects, CarbonProc
|
||||||
|
{$endif};
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -65,6 +69,7 @@ type
|
|||||||
{ TXibItem }
|
{ TXibItem }
|
||||||
|
|
||||||
constructor TXibItem.Create(const AName,ASourceFile,ADescr, IconFileName:AnsiString);
|
constructor TXibItem.Create(const AName,ASourceFile,ADescr, IconFileName:AnsiString);
|
||||||
|
{$ifdef darwin}
|
||||||
var
|
var
|
||||||
url : CFURLRef;
|
url : CFURLRef;
|
||||||
data : CGImageSourceRef;
|
data : CGImageSourceRef;
|
||||||
@ -110,6 +115,11 @@ begin
|
|||||||
CFRelease(url);
|
CFRelease(url);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$else}
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
end;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
destructor TXibItem.Destroy;
|
destructor TXibItem.Destroy;
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user