mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-12-13 05:16:26 +00:00
added some tests
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@665 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
55867c169a
commit
76dc8a86b3
30
SConstruct
30
SConstruct
@ -137,6 +137,8 @@ flavour = ARGUMENTS.get('flavor')
|
||||
if (flavour == 'debug'):
|
||||
compileFlags.append('-g')
|
||||
cppDefines.append('LOGGING')
|
||||
elif (flavour == 'devel'):
|
||||
compileFlags.append('-g')
|
||||
else:
|
||||
compileFlags.append('-O3')
|
||||
|
||||
@ -156,32 +158,42 @@ env['CPPDEFINES'] = cppDefines
|
||||
|
||||
|
||||
# Configuration tests section
|
||||
tests = {'CheckWXConfig' : wxconfig.CheckWXConfig}
|
||||
tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
|
||||
'CheckPKGConfig' : utils.CheckPKGConfig,
|
||||
'CheckPKG' : utils.CheckPKG,
|
||||
'CheckSDL' : utils.CheckSDL}
|
||||
|
||||
conf = env.Configure(custom_tests = tests)
|
||||
|
||||
if not conf.CheckPKGConfig('0.15.0'):
|
||||
Exit(1)
|
||||
|
||||
if not conf.CheckSDL('1.0.0'):
|
||||
Exit(1)
|
||||
|
||||
if not conf.CheckPKG('ao'):
|
||||
Exit(1)
|
||||
|
||||
# handling wx flags CCFLAGS should be created before
|
||||
if not env['nowx']:
|
||||
env['wxconfig'] = 'wx-config'
|
||||
env['build_platform'] = env['PLATFORM']
|
||||
env['target_platform'] = env['PLATFORM']
|
||||
|
||||
if not conf.CheckWXConfig(
|
||||
'2.8', ['gl', 'adv', 'core', 'base'], env['debug']
|
||||
):
|
||||
print 'gui build requires wxwidgets >= 2.8'
|
||||
Exit(1)
|
||||
|
||||
wxconfig.ParseWXConfig(env)
|
||||
|
||||
# After all configuration tests are done
|
||||
env = conf.Finish()
|
||||
|
||||
#wx windows flags
|
||||
if not env['nowx']:
|
||||
wxconfig.ParseWXConfig(env)
|
||||
|
||||
#get sdl stuff
|
||||
env.ParseConfig("sdl-config --cflags --libs")
|
||||
env.ParseConfig('sdl-config --cflags --libs')
|
||||
|
||||
# lib ao (needed for sound plugins)
|
||||
env.ParseConfig("pkg-config --cflags --libs ao")
|
||||
env.ParseConfig('pkg-config --cflags --libs ao')
|
||||
|
||||
# add methods from utils to env
|
||||
env.AddMethod(utils.filterWarnings)
|
||||
|
@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
# methods that should be added to env
|
||||
def filterWarnings(self, flags):
|
||||
return ' '.join(
|
||||
@ -5,3 +7,31 @@ def filterWarnings(self, flags):
|
||||
for flag in flags
|
||||
if not flag.startswith('-W')
|
||||
)
|
||||
|
||||
# taken from scons wiki
|
||||
def CheckPKGConfig(context, version):
|
||||
context.Message( 'Checking for pkg-config version > %s... ' % version)
|
||||
ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0]
|
||||
context.Result( ret )
|
||||
return ret
|
||||
|
||||
def CheckPKG(context, name):
|
||||
context.Message( 'Checking for %s... ' % name )
|
||||
ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0]
|
||||
context.Result( ret )
|
||||
return ret
|
||||
|
||||
|
||||
def CheckSDL(context, version):
|
||||
context.Message( 'Checking for sdl lib version > %s... ' % version)
|
||||
sdl_config = context.env.WhereIs('sdl-config')
|
||||
if sdl_config == None:
|
||||
ret = 0
|
||||
else:
|
||||
found_ver = os.popen('sdl-config --version').read().strip()
|
||||
required = [int(n) for n in version.split(".")]
|
||||
found = [int(n) for n in found_ver.split(".")]
|
||||
ret = (found >= required)
|
||||
|
||||
context.Result( ret )
|
||||
return ret
|
||||
|
@ -20,7 +20,7 @@ def SystemBacktick(program):
|
||||
return [retcode, output]
|
||||
|
||||
def SystemWXConfig(env, args):
|
||||
if sys.platform=='win32':
|
||||
if env['PLATFORM'] == 'win32':
|
||||
return SystemBacktick(env['wxconfig']+' --wxcfg='+env['ENV']['WXCFG']+' '+args+env['wxconfig_postargs'])
|
||||
else:
|
||||
return SystemBacktick(env['wxconfig']+' '+args+env['wxconfig_postargs'])
|
||||
@ -57,15 +57,6 @@ def CheckWXConfigComponents(context, libraries):
|
||||
def CheckWXConfigWin(context, version, debug):
|
||||
context.Message('Checking for wxWidgets >= %s... '%version)
|
||||
|
||||
# Try to find it in path
|
||||
wx_prog = context.env.WhereIs(context.env['wxconfig'])
|
||||
if wx_prog == None:
|
||||
# You could supply wx-config.exe as a fallback option.
|
||||
#wx_prog = os.path.join('scons','wx-config')
|
||||
context.Message('wx-config not found...')
|
||||
return False
|
||||
context.env['wxconfig'] = wx_prog
|
||||
|
||||
# Some environment variables are required for wx-config to work, check them.
|
||||
if 'WXWIN' not in context.env['ENV']:
|
||||
# TODO: maybe try some default location like "C:\Program Files\wxWidgets-*" or registry
|
||||
@ -142,7 +133,7 @@ def CheckWXConfigPosixFind(context, debug):
|
||||
def CheckWXConfigPosix(context, version, debug):
|
||||
# TODO: try several wx-config names
|
||||
context.Message('Checking for wxWidgets >= %s... '%version)
|
||||
|
||||
|
||||
# If supplied wx-config doesn't work, try to find another one
|
||||
if SystemWXConfig(context.env,'--libs')[0] != 0:
|
||||
wx_prog = CheckWXConfigPosixFind(context, debug)
|
||||
@ -174,11 +165,18 @@ def CheckWXConfigPosix(context, version, debug):
|
||||
|
||||
def CheckWXConfig(context, version, components, debug = False):
|
||||
context.env['wxconfig_postargs']= ''
|
||||
build_platform=context.env['build_platform']
|
||||
target_platform=context.env['target_platform']
|
||||
|
||||
# Try to find it in path
|
||||
wx_prog = context.env.WhereIs('wx-config')
|
||||
if wx_prog == None:
|
||||
# You could supply wx-config.exe as a fallback option.
|
||||
#wx_prog = os.path.join('scons','wx-config')
|
||||
context.Message('wx-config not found...')
|
||||
return False
|
||||
context.env['wxconfig'] = wx_prog
|
||||
|
||||
# Get wx-config invocation and check version
|
||||
if build_platform=='win32' and target_platform=='win32':
|
||||
if context.env['PLATFORM'] == 'win32':
|
||||
res = CheckWXConfigWin(context, version, debug)
|
||||
else:
|
||||
res = CheckWXConfigPosix(context, version, debug)
|
||||
@ -193,10 +191,9 @@ def CheckWXConfig(context, version, components, debug = False):
|
||||
return res
|
||||
|
||||
def ParseWXConfig(env):
|
||||
build_platform=env['build_platform']
|
||||
target_platform=env['target_platform']
|
||||
|
||||
# Windows doesn't work with ParseConfig (yet) :(
|
||||
if build_platform=='win32' and target_platform=='win32':
|
||||
if env['PLATFORM'] == 'win32':
|
||||
# Use wx-config, yay!
|
||||
# ParseConfig() on windows is broken, so the following is done instead
|
||||
cflags = SystemWXConfig(env,'--cxxflags')[1]
|
||||
|
Loading…
Reference in New Issue
Block a user