From 8aa15da7ed34e82b331825f1af9548275dbeff09 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Wed, 17 Oct 2012 10:53:30 +0100 Subject: Fixes build error about units not for a specific target. Because the X11 and GDI targets have units with the same names (ie: fpg_impl.pas etc) the last enry overrides the platform target. So if we compile under Linux, it will complain that fpg_impl.pas is for the Windows target only. To work around this problem, we have to add some units in code blocks for specific targets. --- src/fpmake.pp | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/fpmake.pp b/src/fpmake.pp index 616f7f8b..a0424dd1 100644 --- a/src/fpmake.pp +++ b/src/fpmake.pp @@ -151,24 +151,29 @@ begin { corelib/x11 } - T := P.Targets.AddUnit('fpg_keyconv_x11.pas', AllUnixOSes); - T := P.Targets.AddUnit('fpg_netlayer_x11.pas', AllUnixOSes); - T := P.Targets.AddUnit('fpg_xft_x11.pas', AllUnixOSes); - T := P.Targets.AddUnit('fpg_impl.pas', AllUnixOSes); - T := P.Targets.AddUnit('fpg_x11.pas', AllUnixOSes); - T.Dependencies.AddUnit('fpg_xft_x11'); - T.Dependencies.AddUnit('fpg_netlayer_x11'); - T.Dependencies.AddUnit('fpg_base'); - T.Dependencies.AddUnit('fpg_impl'); - T := P.Targets.AddUnit('fpg_interface.pas', AllUnixOSes); + if Defaults.OS in AllUnixOSes then + begin + T := P.Targets.AddUnit('fpg_keyconv_x11.pas', AllUnixOSes); + T := P.Targets.AddUnit('fpg_netlayer_x11.pas', AllUnixOSes); + T := P.Targets.AddUnit('fpg_xft_x11.pas', AllUnixOSes); + T := P.Targets.AddUnit('fpg_impl.pas', AllUnixOSes); + T := P.Targets.AddUnit('fpg_x11.pas', AllUnixOSes); + T.Dependencies.AddUnit('fpg_xft_x11'); + T.Dependencies.AddUnit('fpg_netlayer_x11'); + T.Dependencies.AddUnit('fpg_base'); + T.Dependencies.AddUnit('fpg_impl'); + T := P.Targets.AddUnit('fpg_interface.pas', AllUnixOSes); + end; { corelib/gdi } - T := P.Targets.AddUnit('fpg_impl.pas', AllWindowsOSes); - T := P.Targets.AddUnit('fpg_gdi.pas', AllWindowsOSes); - T.Dependencies.AddInclude('fpg_keys_gdi.inc', AllWindowsOSes); - T := P.Targets.AddUnit('fpg_interface.pas', AllWindowsOSes); - + if Defaults.OS in AllWindowsOSes then + begin + T := P.Targets.AddUnit('fpg_impl.pas', AllWindowsOSes); + T := P.Targets.AddUnit('fpg_gdi.pas', AllWindowsOSes); + T.Dependencies.AddInclude('fpg_keys_gdi.inc', AllWindowsOSes); + T := P.Targets.AddUnit('fpg_interface.pas', AllWindowsOSes); + end; { gui/db } T := P.Targets.AddUnit('fpgui_db.pas'); -- cgit v1.2.3-70-g09d2