You've already forked lazarus-ccr
iphonelazext: fix wrong SDK selection. Fixed Xcode project updates
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1151 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -63,9 +63,9 @@ var
|
|||||||
ext : String;
|
ext : String;
|
||||||
begin
|
begin
|
||||||
if Project.LazCompilerOptions.TargetFilename<>'' then
|
if Project.LazCompilerOptions.TargetFilename<>'' then
|
||||||
Result:=Project.LazCompilerOptions.TargetFilename
|
Result:=ExtractFileName(Project.LazCompilerOptions.TargetFilename)
|
||||||
else begin
|
else begin
|
||||||
Result:=Project.MainFile.Filename;
|
Result:=ExtractFileName(Project.MainFile.Filename);
|
||||||
ext:=ExtractFileExt(Result);
|
ext:=ExtractFileExt(Result);
|
||||||
Result:=Copy(Result, 1, length(Result)-length( ext ) );
|
Result:=Copy(Result, 1, length(Result)-length( ext ) );
|
||||||
end;
|
end;
|
||||||
@ -345,7 +345,8 @@ begin
|
|||||||
|
|
||||||
build := TStringList.Create;
|
build := TStringList.Create;
|
||||||
|
|
||||||
tname:=ExtractFileName( ChangeFileExt(LazarusIDE.ActiveProject.MainFile.Filename, ''));
|
tname:=ExtractFileName( LazarusIDE.ActiveProject.MainFile.Filename);
|
||||||
|
tname:=ChangeFileExt(tname, '');
|
||||||
plistname:=tname+'.plist';
|
plistname:=tname+'.plist';
|
||||||
|
|
||||||
build.Values['INFOPLIST_FILE'] := '"'+plistname+'"';
|
build.Values['INFOPLIST_FILE'] := '"'+plistname+'"';
|
||||||
|
@ -244,8 +244,11 @@ begin
|
|||||||
]);
|
]);
|
||||||
if FileExists(InfoFileName) then DeleteFile(InfoFileName);
|
if FileExists(InfoFileName) then DeleteFile(InfoFileName);
|
||||||
fs:=TFileStream.Create(InfoFileName, fmCreate or fmOpenWrite);
|
fs:=TFileStream.Create(InfoFileName, fmCreate or fmOpenWrite);
|
||||||
if s<>'' then fs.Write(s[1], length(s));
|
try
|
||||||
fs.Free;
|
if s<>'' then fs.Write(s[1], length(s));
|
||||||
|
finally
|
||||||
|
fs.Free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -310,8 +310,8 @@ begin
|
|||||||
info:=GetSDKInfo(SDKVer);
|
info:=GetSDKInfo(SDKVer);
|
||||||
if not Assigned(info) then Result:=''
|
if not Assigned(info) then Result:=''
|
||||||
else begin
|
else begin
|
||||||
if simulator then Result:=info.devName
|
if simulator then Result:=info.simName
|
||||||
else Result:=info.simName;
|
else Result:=info.devName;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -322,8 +322,8 @@ begin
|
|||||||
info:=GetSDKInfo(SDKVer);
|
info:=GetSDKInfo(SDKVer);
|
||||||
if not Assigned(info) then Result:=''
|
if not Assigned(info) then Result:=''
|
||||||
else begin
|
else begin
|
||||||
if simulator then Result:=info.devPath
|
if simulator then Result:=info.simPath
|
||||||
else Result:=info.simPath;
|
else Result:=info.devPath;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ type
|
|||||||
Name : String;
|
Name : String;
|
||||||
Alternate : String; {alternate SDK -> iphonesimulator for iphoneos}
|
Alternate : String; {alternate SDK -> iphonesimulator for iphoneos}
|
||||||
Version : String;
|
Version : String;
|
||||||
isDevice : Boolean; {true for real iPhoneOS, false for iPhoneSimulator}
|
isSim : Boolean; {true for real iPhoneOS, false for iPhoneSimulator}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// todo: implement reading .plist via OSX functions! (in case a .plist format changes)
|
// todo: implement reading .plist via OSX functions! (in case a .plist format changes)
|
||||||
@ -440,7 +440,7 @@ const
|
|||||||
PlatformName: array [Boolean] of string = ('iPhoneOS.platform','iPhoneSimulator.platform');
|
PlatformName: array [Boolean] of string = ('iPhoneOS.platform','iPhoneSimulator.platform');
|
||||||
SDKSubDir = PathDelim+'Developer'+PathDelim+'SDKs'+PathDelim;
|
SDKSubDir = PathDelim+'Developer'+PathDelim+'SDKs'+PathDelim;
|
||||||
var
|
var
|
||||||
isdev : Boolean;
|
isSim : Boolean;
|
||||||
dir : string;
|
dir : string;
|
||||||
sr : TSearchRec;
|
sr : TSearchRec;
|
||||||
sdks : array of TSDKDescription;
|
sdks : array of TSDKDescription;
|
||||||
@ -466,13 +466,13 @@ begin
|
|||||||
|
|
||||||
cnt:=0;
|
cnt:=0;
|
||||||
|
|
||||||
for isdev:=false to true do begin
|
for isSim:=false to true do begin
|
||||||
dir := IncludeTrailingPathDelimiter(PlatformDir) + PlatformName[isdev] + SDKSubDir;
|
dir := IncludeTrailingPathDelimiter(PlatformDir) + PlatformName[isSim] + SDKSubDir;
|
||||||
if FindFirst(dir+'*', faAnyFile, sr)=0 then begin
|
if FindFirst(dir+'*', faAnyFile, sr)=0 then begin
|
||||||
repeat
|
repeat
|
||||||
if (sr.Attr and faDirectory>0) and (ExtractFileExt(sr.Name) = '.sdk') then
|
if (sr.Attr and faDirectory>0) and (ExtractFileExt(sr.Name) = '.sdk') then
|
||||||
if isSDKDir( dir + sr.Name, descr) then begin
|
if isSDKDir( dir + sr.Name, descr) then begin
|
||||||
descr.isDevice:=isdev;
|
descr.isSim:=isSim;
|
||||||
AddDescription(descr);
|
AddDescription(descr);
|
||||||
end;
|
end;
|
||||||
until FindNext(sr)<>0;
|
until FindNext(sr)<>0;
|
||||||
@ -481,11 +481,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
for i:=0 to cnt-1 do
|
for i:=0 to cnt-1 do
|
||||||
if sdks[i].isDevice then begin
|
if not sdks[i].isSim then begin
|
||||||
simname:='';
|
simname:='';
|
||||||
simpath:='';
|
simpath:='';
|
||||||
for j:=0 to cnt-1 do
|
for j:=0 to cnt-1 do
|
||||||
if (not sdks[j].isDevice) and (sdks[i].Alternate=sdks[j].Name) then begin
|
if (sdks[j].isSim) and (sdks[i].Alternate=sdks[j].Name) then begin
|
||||||
simname:=sdks[j].Name;
|
simname:=sdks[j].Name;
|
||||||
simpath:=sdks[j].FullPath;
|
simpath:=sdks[j].FullPath;
|
||||||
end;
|
end;
|
||||||
|
@ -63,8 +63,6 @@ begin
|
|||||||
pth:=allfiles[i];
|
pth:=allfiles[i];
|
||||||
if (FilterMask='') or (not MaskList.Matches(pth)) then begin
|
if (FilterMask='') or (not MaskList.Matches(pth)) then begin
|
||||||
linkname:=linkdir+Copy(pth, length(curdir), length(pth));
|
linkname:=linkdir+Copy(pth, length(curdir), length(pth));
|
||||||
writeln('link from: ', pth);
|
|
||||||
writeln(' to: ', linkname);
|
|
||||||
fpSymlink(PAnsiChar(pth), PAnsiChar(linkname));
|
fpSymlink(PAnsiChar(pth), PAnsiChar(linkname));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user