mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-03 16:16:05 +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
3 changed files with 65 additions and 26 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue