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:
skalogryz
2016-01-06 13:32:35 +00:00
parent f92d194a8d
commit f3a55dedd4
3 changed files with 25 additions and 5 deletions

View File

@ -19,7 +19,7 @@ unit ideext;
interface
uses
Unix, BaseUnix, process,
process,
Classes, SysUtils, contnrs,
Graphics, Controls, Forms, Dialogs, LazFileUtils,
{Lazarus Interface}
@ -46,7 +46,7 @@ type
TiPhoneExtension = class(TObject)
protected
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 WriteIconTo(const FullName: String): Boolean;
@ -58,7 +58,9 @@ type
function GetXcodeProjDirName: string;
public
SimPID : Integer;
{$ifdef darwin}
SimLogger : TPTYReader;
{$endif}
constructor Create;
procedure UpdateXcode(Sender: TObject);
procedure SimRun(Sender: TObject);
@ -151,8 +153,10 @@ begin
if nm<>'' then begin
dstpath:=UTF8Encode(exepath);
{$ifdef darwin}
FpUnlink(dstpath);
fpSymlink(PChar(nm), PChar(dstpath));
{$endif}
end;
xiblist := TStringList.Create;
@ -516,6 +520,9 @@ begin
prj := GetXcodeProjDirName;
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
IDEMsg('xcodebuild failed');
Exit;
@ -546,6 +553,7 @@ begin
Exit;
end;
IDEMsg('Success. Application pid='+IntToStr(pid));
{$endif}
end;
procedure TiPhoneExtension.SimTerminate(Sender: TObject);
@ -558,8 +566,10 @@ begin
if SimPID>0 then begin
StopProc(SimPID);
SimPID:=-1;
{$ifdef darwin}
SimLogger.Free;
SimLogger:=nil;
{$endif}
end;
end;

View File

@ -211,7 +211,7 @@ begin
RunCommand('xcrun', ['simctl', 'list', 'devices', '-j'], s);
try
dt:=nil;
j:=TJSONParser.Create(s, []);
j:=TJSONParser.Create(s);
try
dt:=j.Parse;
finally

View File

@ -5,11 +5,15 @@ unit newXibDialog;
interface
uses
{$ifdef lclcarbon}
MacOSAll,
{$endif}
Types,Classes,SysUtils,FileUtil,LResources,Forms,Controls,Graphics,Dialogs,StdCtrls,LCLProc,
Grids,
Grids
//todo: use LCL file loading and drawing, instead of OSX
CarbonGDIObjects, CarbonProc;
{$ifdef lclcarbon}
,CarbonGDIObjects, CarbonProc
{$endif};
type
@ -65,6 +69,7 @@ type
{ TXibItem }
constructor TXibItem.Create(const AName,ASourceFile,ADescr, IconFileName:AnsiString);
{$ifdef darwin}
var
url : CFURLRef;
data : CGImageSourceRef;
@ -110,6 +115,11 @@ begin
CFRelease(url);
end;
end;
{$else}
begin
inherited Create;
end;
{$endif}
destructor TXibItem.Destroy;
begin