mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 11:09:32 +02:00
IDE: moved fixed LCL linker options to conditionals
git-svn-id: trunk@29187 -
This commit is contained in:
parent
f70004e7a6
commit
15ca442dd7
@ -228,7 +228,7 @@ var
|
||||
Options: TBuildLazarusProfile;
|
||||
i: Integer;
|
||||
MMDef: TMakeModeDef;
|
||||
ExOptions, LinkerAddition: String;
|
||||
ExOptions: String;
|
||||
CurMakeMode: TMakeMode;
|
||||
WorkingDirectory: String;
|
||||
OutputDirRedirected, UpdateRevisionInc: boolean;
|
||||
@ -328,16 +328,6 @@ begin
|
||||
and (not CheckDirectoryWritable(WorkingDirectory)) then
|
||||
exit(mrCancel);
|
||||
|
||||
// add Linker options for wigdet set
|
||||
LinkerAddition := LCLWidgetLinkerAddition[Options.TargetPlatform];
|
||||
if LinkerAddition <> '' then
|
||||
begin
|
||||
if ExOptions <> '' then
|
||||
ExOptions := ExOptions + ' ' + LinkerAddition
|
||||
else
|
||||
ExOptions := LinkerAddition;
|
||||
end;
|
||||
|
||||
if ExOptions<>'' then
|
||||
Tool.EnvironmentOverrides.Values['OPT'] := ExOptions;
|
||||
if not UpdateRevisionInc then
|
||||
|
@ -658,34 +658,6 @@ const
|
||||
'Build',
|
||||
'Run'
|
||||
);
|
||||
LCLWidgetLinkerAddition: array[TLCLPlatform] of string = (
|
||||
{$IFDEF DARWIN}
|
||||
' -Fl/usr/X11R6/lib -Fl/sw/lib', // gtk
|
||||
{$ELSE}
|
||||
'', // gtk
|
||||
{$ENDIF}
|
||||
{$IFDEF DARWIN}
|
||||
' -Fl/usr/X11R6/lib -Fl/sw/lib -Fl/sw/lib/pango-ft219/lib', // gtk2
|
||||
{$ELSE}
|
||||
'', // gtk2
|
||||
{$ENDIF}
|
||||
'', // win32
|
||||
'', // wince
|
||||
{$IFDEF DARWIN}
|
||||
' -k-framework -kCarbon -k-framework -kOpenGL -k''-dylib_file'' -k''/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib''', // carbon
|
||||
{$ELSE}
|
||||
'', //carbon
|
||||
{$ENDIF}
|
||||
'', // qt
|
||||
'', // fpGUI
|
||||
'', // noGUI
|
||||
{$IFDEF DARWIN}
|
||||
' -k-framework -kCocoa', // Cocoa
|
||||
{$ELSE}
|
||||
'', // Cocoa
|
||||
{$ENDIF}
|
||||
'' // android
|
||||
);
|
||||
|
||||
type
|
||||
TRunCompilerWithOptions = function(ExtTool: TIDEExternalToolOptions;
|
||||
@ -2598,11 +2570,6 @@ begin
|
||||
//debugln(['TBaseCompilerOptions.MakeOptionsString InhLinkerOpts="',InhLinkerOpts,'"']);
|
||||
if InhLinkerOpts<>'' then
|
||||
switches := switches + ' ' + ConvertOptionsToCmdLine(' ','-k', InhLinkerOpts);
|
||||
|
||||
// add Linker options for widgetset
|
||||
LinkerAddition := LCLWidgetLinkerAddition[DirNameToLCLPlatform(GetEffectiveLCLWidgetType)];
|
||||
if LinkerAddition <> '' then
|
||||
switches := switches + ' ' + LinkerAddition;
|
||||
end;
|
||||
|
||||
if Win32GraphicApp then
|
||||
|
@ -37,13 +37,6 @@ begin
|
||||
if DirPathExists(Directory) then List.Add(Directory);
|
||||
end;
|
||||
|
||||
procedure GetDefaultLCLLibPaths(List: TStrings);
|
||||
begin
|
||||
// needed for gtk, but carbon is now default widgetset:
|
||||
//IfDirectoryExistsAdd('/usr/X11R6/lib',List);
|
||||
//IfDirectoryExistsAdd('/sw/lib',List);
|
||||
end;
|
||||
|
||||
{$I ../unix/lazbaseconf.inc}
|
||||
|
||||
|
||||
|
@ -32,10 +32,6 @@
|
||||
uses
|
||||
BaseUnix, Unix;
|
||||
|
||||
procedure GetDefaultLCLLibPaths(List: TStrings);
|
||||
begin
|
||||
end;
|
||||
|
||||
{$I ../unix/lazbaseconf.inc}
|
||||
|
||||
|
||||
|
@ -32,10 +32,6 @@
|
||||
uses
|
||||
BaseUnix, Unix;
|
||||
|
||||
procedure GetDefaultLCLLibPaths(List: TStrings);
|
||||
begin
|
||||
end;
|
||||
|
||||
{$I ../unix/lazbaseconf.inc}
|
||||
|
||||
|
||||
|
@ -32,10 +32,6 @@
|
||||
uses
|
||||
baseunix, unix;
|
||||
|
||||
procedure GetDefaultLCLLibPaths(List: TStrings);
|
||||
begin
|
||||
end;
|
||||
|
||||
{$I ../unix/lazbaseconf.inc}
|
||||
|
||||
|
||||
|
@ -31,16 +31,6 @@
|
||||
uses
|
||||
BaseUnix, Unix;
|
||||
|
||||
procedure IfDirectoryExistsAdd(const Directory: string; List: TStrings);
|
||||
begin
|
||||
if DirPathExists(Directory) then List.Add(Directory);
|
||||
end;
|
||||
|
||||
procedure GetDefaultLCLLibPaths(List: TStrings);
|
||||
begin
|
||||
IfDirectoryExistsAdd('/usr/X11R6/lib',List);
|
||||
end;
|
||||
|
||||
{$I ../unix/lazbaseconf.inc}
|
||||
|
||||
|
||||
|
@ -40,10 +40,6 @@ var
|
||||
DefaultFPCTarget,
|
||||
DefaultFPCVersion : string;
|
||||
|
||||
procedure GetDefaultLCLLibPaths(List: TStrings);
|
||||
begin
|
||||
end;
|
||||
|
||||
type
|
||||
TGetFileListProc = procedure (List: TStrings);
|
||||
|
||||
|
@ -119,8 +119,6 @@ function GetDefaultTargetOS: string;
|
||||
|
||||
function GetDefaultLCLWidgetType: TLCLPlatform;
|
||||
function DirNameToLCLPlatform(const ADirName: string): TLCLPlatform;
|
||||
procedure GetDefaultLCLLibPaths(List: TStrings);
|
||||
function GetDefaultLCLLibPaths(const Prefix, Postfix, Separator: string): string;
|
||||
|
||||
// returrns the default browser
|
||||
procedure GetDefaultBrowser(var Browser, Params: string);
|
||||
@ -236,21 +234,6 @@ begin
|
||||
Result:=lpGtk2;
|
||||
end;
|
||||
|
||||
function GetDefaultLCLLibPaths(const Prefix, Postfix, Separator: string): string;
|
||||
var
|
||||
List: TStringList;
|
||||
i: Integer;
|
||||
begin
|
||||
List:=TStringList.Create;
|
||||
GetDefaultLCLLibPaths(List);
|
||||
Result:='';
|
||||
for i:=0 to List.Count-1 do begin
|
||||
if Result<>'' then Result:=Result+Separator;
|
||||
Result:=Result+Prefix+List[i]+PostFix;
|
||||
end;
|
||||
List.Free;
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
getPrimaryConfigPath function
|
||||
---------------------------------------------------------------------------}
|
||||
|
@ -61,6 +61,8 @@ if TargetOS='darwin' then begin
|
||||
+' ''-dylib_file'' ''/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib''';
|
||||
end else if LCLWidgetType1='cocoa' then
|
||||
UsageLinkerOptions := '-framework Cocoa';
|
||||
end else if TargetOS='solaris' then begin
|
||||
UsageLibraryPath:='/usr/X11R6/lib';
|
||||
end;"/>
|
||||
<BuildMacros>
|
||||
<Count Value="2"/>
|
||||
|
@ -1451,19 +1451,6 @@ begin
|
||||
end;
|
||||
|
||||
function TLazPackageGraph.CreateLCLPackage: TLazPackage;
|
||||
|
||||
procedure AddLCLLinkPaths(UsageOptions: TAdditionalCompilerOptions);
|
||||
var
|
||||
NewPath: string;
|
||||
OldLibPath: String;
|
||||
begin
|
||||
NewPath:=GetDefaultLCLLibPaths('','',';');
|
||||
OldLibPath:=UsageOptions.LibraryPath;
|
||||
if OldLibPath<>'' then OldLibPath:=OldLibPath+';';
|
||||
OldLibPath:=OldLibPath+NewPath;
|
||||
UsageOptions.LibraryPath:=NewPath;
|
||||
end;
|
||||
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
@ -1514,8 +1501,62 @@ begin
|
||||
// add include path
|
||||
CompilerOptions.IncludePath:=SetDirSeparators(
|
||||
'$(LazarusDir)/lcl/include;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)');
|
||||
AddLCLLinkPaths(UsageOptions);
|
||||
CompilerOptions.CustomOptions:='$(IDEBuildOptions)';
|
||||
CompilerOptions.Conditionals:=
|
||||
'// LCLWidgetType'+LineEnding
|
||||
+'if undefined(LCLWidgetType) then begin'+LineEnding
|
||||
+' if (TargetOS=''win32'') or (TargetOS=''win64'') then'+LineEnding
|
||||
+' LCLWidgetType := ''win32'''+LineEnding
|
||||
+' else if TargetOS=''wince'' then'+LineEnding
|
||||
+' LCLWidgetType := ''wince'''+LineEnding
|
||||
+' else if TargetOS=''darwin'' then'+LineEnding
|
||||
+' LCLWidgetType := ''carbon'''+LineEnding
|
||||
+' else'+LineEnding
|
||||
+' LCLWidgetType := ''gtk2'';'+LineEnding
|
||||
+'end;'+LineEnding
|
||||
+''+LineEnding
|
||||
+'// widget set specific options'+LineEnding
|
||||
+'base := ''interfaces/''+LCLWidgetType+''/'';'+LineEnding
|
||||
+'if LCLWidgetType=''gtk'' then'+LineEnding
|
||||
+' CustomOptions := ''-dgtk1'''+LineEnding
|
||||
+'else if LCLWidgetType=''carbon'' then begin'+LineEnding
|
||||
+' CustomOptions := ''-dcarbon'';'+LineEnding
|
||||
+' UnitPath := base+''objc;'''+LineEnding
|
||||
+' +base+''pascocoa/appkit;'''+LineEnding
|
||||
+' +base+''pascocoa/foundation'';'+LineEnding
|
||||
+' IncPath := UnitPath;'+LineEnding
|
||||
+'end else if LCLWidgetType=''wince'' then begin'+LineEnding
|
||||
+' CustomOptions := ''-dDisableChecks'';'+LineEnding
|
||||
+'end else if LCLWidgetType=''fpgui'' then begin'+LineEnding
|
||||
+' if undefined(fpGUIPlatform) then begin'+LineEnding
|
||||
+' if SrcOS=''win32'' then'+LineEnding
|
||||
+' fpGUIPlatform := ''gdi'''+LineEnding
|
||||
+' else'+LineEnding
|
||||
+' fpGUIPlatform := ''x11'';'+LineEnding
|
||||
+' end;'+LineEnding
|
||||
+' CustomOptions := '' -dfpgui''+fpGUIPlatform;'+LineEnding
|
||||
+' UnitPath := base+''gui;'''+LineEnding
|
||||
+' +base+''corelib;'''+LineEnding
|
||||
+' +base+''corelib/''+fpGUIPlatform;'+LineEnding
|
||||
+' IncPath := UnitPath;'+LineEnding
|
||||
+'end;'+LineEnding
|
||||
+''+LineEnding
|
||||
+'// linker options'+LineEnding
|
||||
+'if TargetOS=''darwin'' then begin'+LineEnding
|
||||
+' if LCLWidgetType=''gtk'' then'+LineEnding
|
||||
+' UsageLibraryPath := ''/usr/X11R6/lib;/sw/lib'''+LineEnding
|
||||
+' else if LCLWidgetType=''gtk2'' then'+LineEnding
|
||||
+' UsageLibraryPath := ''/usr/X11R6/lib;/sw/lib;/sw/lib/pango-ft219/lib'''+LineEnding
|
||||
+' else if LCLWidgetType=''carbon'' then begin'+LineEnding
|
||||
+' UsageLinkerOptions := ''-framework Carbon'''+LineEnding
|
||||
+' +'' -framework OpenGL'''+LineEnding
|
||||
+' +'' -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib'';'+LineEnding
|
||||
+' end else if LCLWidgetType=''cocoa'' then'+LineEnding
|
||||
+' UsageLinkerOptions := ''-framework Cocoa'';'+LineEnding
|
||||
+'end else if TargetOS=''solaris'' then begin'+LineEnding
|
||||
+' UsageLibraryPath:=''/usr/X11R6/lib'';'+LineEnding
|
||||
+'end;'+LineEnding
|
||||
+'';
|
||||
|
||||
// use the lcl/units/$(TargetCPU)-$(TargetOS)/alllclunits.o
|
||||
// file as indicator, if LCL has been recompiled
|
||||
|
Loading…
Reference in New Issue
Block a user