From e2c8e95cfc22ddf691056c1243f0908f6c771709 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 2 Mar 2013 23:00:10 +0000 Subject: [PATCH] Move names of platform-specific sources into subclasses --- SConstruct | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index d7372ce22..dce42e843 100644 --- a/SConstruct +++ b/SConstruct @@ -55,6 +55,7 @@ class DXXProgram: def __init__(self): self.ogllibs = '' self.osasmdef = None + self.platform_sources = [] # Settings to apply to mingw32 builds class Win32PlatformSettings(_PlatformSettings): def __init__(self,user_settings): @@ -68,6 +69,7 @@ class DXXProgram: env.RES('arch/win32/%s.rc' % program.target) env.Append(CPPDEFINES = ['_WIN32']) env.Append(CPPPATH = ['arch/win32/include']) + self.platform_sources = ['arch/win32/messagebox.c'] # Settings to apply to Apple builds # This appears to be unused. The reference to sdl_only fails to # execute. @@ -87,6 +89,7 @@ class DXXProgram: self.libs = ['../physfs/build/Debug/libphysfs.dylib'] def adjust_environment(self,program,env): env.Append(CPPDEFINES = ['__unix__']) + self.platform_sources = ['arch/cocoa/SDLMain.m', 'arch/carbon/messagebox.c'] # Settings to apply to Linux builds class LinuxPlatformSettings(_PlatformSettings): def __init__(self,user_settings): @@ -153,11 +156,9 @@ class DXXProgram: if sys.platform == 'win32': print "%s: compiling on Windows" % self.PROGRAM_NAME platform = self.Win32PlatformSettings - self.common_sources += ['arch/win32/messagebox.c'] elif sys.platform == 'darwin': print "%s: compiling on Mac OS X" % self.PROGRAM_NAME platform = self.DarwinPlatformSettings - self.common_sources += ['arch/cocoa/SDLMain.m', 'arch/carbon/messagebox.c'] sys.path += ['./arch/cocoa'] VERSION = str(VERSION_MAJOR) + '.' + str(VERSION_MINOR) if (VERSION_MICRO): @@ -172,6 +173,7 @@ class DXXProgram: self.platform_settings = platform(self.user_settings) self.platform_settings.adjust_environment(self, env) self.platform_settings.libs += ['physfs', 'm'] + self.common_sources += self.platform_settings.platform_sources def process_user_settings(self): env = self.env