From 63b1abc80a6e83d64976e1537cf7f8d4bf009ee3 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 16 Mar 2013 23:15:01 +0000 Subject: [PATCH] Store fixed values at class scope --- SConstruct | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/SConstruct b/SConstruct index a8228c015..74c4ac54b 100644 --- a/SConstruct +++ b/SConstruct @@ -74,23 +74,19 @@ class DXXCommon: # Base class for platform-specific settings processing class _PlatformSettings: tools = None - def __init__(self): - self.ogllibs = '' - self.osasmdef = None - self.platform_sources = [] + ogllibs = '' + osasmdef = None + platform_sources = [] # Settings to apply to mingw32 builds class Win32PlatformSettings(_PlatformSettings): tools = ['mingw'] - def __init__(self,user_settings): - DXXCommon._PlatformSettings.__init__(self) - self.osdef = '_WIN32' - self.osasmdef = 'win32' + osdef = '_WIN32' + osasmdef = 'win32' def adjust_environment(self,program,env): env.Append(CPPDEFINES = ['_WIN32', 'HAVE_STRUCT_TIMEVAL']) class DarwinPlatformSettings(_PlatformSettings): + osdef = '__APPLE__' def __init__(self,user_settings): - DXXCommon._PlatformSettings.__init__(self) - self.osdef = '__APPLE__' user_settings.asm = 0 self.lflags = os.environ["LDFLAGS"] if os.environ.has_key('LDFLAGS') else '' def adjust_environment(self,program,env): @@ -107,14 +103,14 @@ class DXXCommon: env['LIBPATH'] = '../physfs/build/Debug' # Settings to apply to Linux builds class LinuxPlatformSettings(_PlatformSettings): + osdef = '__LINUX__' + osasmdef = 'elf' + __opengl_libs = ['GL', 'GLU'] def __init__(self,user_settings): - DXXCommon._PlatformSettings.__init__(self) - self.osdef = '__LINUX__' - self.osasmdef = 'elf' if (user_settings.opengles == 1): self.ogllibs = [ user_settings.opengles_lib, 'EGL'] else: - self.ogllibs = ['GL', 'GLU'] + self.ogllibs = self.__opengl_libs def adjust_environment(self,program,env): env.Append(CPPDEFINES = ['__LINUX__', 'HAVE_STRUCT_TIMESPEC', 'HAVE_STRUCT_TIMEVAL']) env.ParseConfig('pkg-config --cflags --libs sdl')