diff --git a/components/iphonelazext/ideext.pas b/components/iphonelazext/ideext.pas index 137d0c2cb..f4c8f9b45 100644 --- a/components/iphonelazext/ideext.pas +++ b/components/iphonelazext/ideext.pas @@ -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; diff --git a/components/iphonelazext/iphonesimctrl.pas b/components/iphonelazext/iphonesimctrl.pas index f713664cf..6a63fc99b 100644 --- a/components/iphonelazext/iphonesimctrl.pas +++ b/components/iphonelazext/iphonesimctrl.pas @@ -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 diff --git a/components/iphonelazext/newxibdialog.pas b/components/iphonelazext/newxibdialog.pas index ab876e759..49b3a5c86 100644 --- a/components/iphonelazext/newxibdialog.pas +++ b/components/iphonelazext/newxibdialog.pas @@ -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