Move names of platform-specific sources into subclasses
This commit is contained in:
parent
2851dac581
commit
e2c8e95cfc
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue