adding lots of features to SConstruct, scons -h to see, known bug: verbose=False is treated as true no idea why...

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@581 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2008-09-19 15:03:31 +00:00
parent 78bb1cf82d
commit f63a845d9f
2 changed files with 82 additions and 15 deletions

View File

@ -3,3 +3,20 @@ GFXPlugin = Plugins/libzeroogl.so
DSPPlugin = Plugins/libdsphle.so DSPPlugin = Plugins/libdsphle.so
PadPlugin = Plugins/libPlugin_nJoy_SDL.so PadPlugin = Plugins/libPlugin_nJoy_SDL.so
WiiMotePlugin = Plugins/libPlugin_Wiimote.so WiiMotePlugin = Plugins/libPlugin_Wiimote.so
[General]
LastFilename =
GCMPathes = 2
GCMPath0 = /storage2
GCMPath1 = /storage2/vm
[Core]
GFXPlugin = Plugins/libzeroogl.so
DSPPlugin = Plugins/libdsphle.so
PadPlugin = Plugins/libpadsimple.so
WiiMotePlugin = Plugins/libPlugin_Wiimote.so
HLEBios = True
UseDynarec = True
UseDualCore = False
SkipIdle = False
LockThreads = True
DefaultGCM = /storage2/vm/Zelda-The wind waker.iso
OptimizeQuantizers = True

View File

@ -1,32 +1,36 @@
# -*- python -*-
import os import os
import sys import sys
# TODO: What is the current Dolphin version? # TODO: how do we use it in help?
dolphin_version = '1.04' name="Dolphin"
Export('dolphin_version') version="SVN"
description="A wii/gamecube emulator"
license="GPL v2"
warnings = [ warnings = [
'all', 'all',
'write-strings', 'write-strings',
#'float-equal',
'shadow', 'shadow',
'pointer-arith', 'pointer-arith',
'packed', 'packed',
'no-conversion', 'no-conversion',
# 'error',
#'unreachable-code',
] ]
compileFlags = [ compileFlags = [
'-fno-exceptions', '-fno-exceptions',
'-fno-strict-aliasing', '-fno-strict-aliasing',
'-msse2', '-msse2',
'-D_FILE_OFFSET_BITS=64',
'-D_LARGEFILE_SOURCE',
'-DGCC_HASCLASSVISIBILITY',
'-fvisibility=hidden', '-fvisibility=hidden',
# '-fomit-frame-pointer'
] ]
#compileFlags += [ '-fomit-frame-pointer' ] cppDefines = [
( '_FILE_OFFSET_BITS', 64),
'_LARGEFILE_SOURCE',
'GCC_HASCLASSVISIBILITY',
]
if sys.platform == 'darwin': if sys.platform == 'darwin':
compileFlags += [ '-I/opt/local/include' ] compileFlags += [ '-I/opt/local/include' ]
@ -72,16 +76,34 @@ if sys.platform == 'darwin':
lib_paths = include_paths lib_paths = include_paths
debug = ARGUMENTS.get('debug', 0) # handle command line options
if int(debug): vars = Variables('custom.py')
vars.AddVariables(
BoolVariable('verbose', 'Set for compilation line', False),
BoolVariable('debug', 'Set for debug build', False),
BoolVariable('lint', 'Set for lint build (extra warnings)', False),
EnumVariable('flavor', 'Choose a build flavor', 'release',
allowed_values=('release', 'devel', 'debug'),
ignorecase=2)
)
# build falvuor
flavour = ARGUMENTS.get('flavor')
if (flavour == 'debug'):
compileFlags.append('-g') compileFlags.append('-g')
compileFlags.append('-DLOGGING') cppDefines.append('LOGGING')
else: else:
compileFlags.append('-O3') compileFlags.append('-O3')
lint = ARGUMENTS.get('lint', 0)
if int(lint): # more warnings
lint = ARGUMENTS.get('lint', False)
if bool(lint):
warnings.append('error') warnings.append('error')
warnings.append('unreachable-code')
warnings.append('float-equal')
compileFlags += [ '-W' + warning for warning in warnings ] compileFlags += [ '-W' + warning for warning in warnings ]
@ -90,17 +112,45 @@ env = Environment(
CXX = 'g++', CXX = 'g++',
CCFLAGS = ' '.join(compileFlags), CCFLAGS = ' '.join(compileFlags),
CXXFLAGS = ' '.join(compileFlags + [ '-fvisibility-inlines-hidden' ]), CXXFLAGS = ' '.join(compileFlags + [ '-fvisibility-inlines-hidden' ]),
CPPDEFINES = cppDefines,
CPPPATH = include_paths, CPPPATH = include_paths,
LIBPATH = lib_paths, LIBPATH = lib_paths,
variables = vars,
ENV = { ENV = {
'PATH' : os.environ['PATH'], 'PATH' : os.environ['PATH'],
'HOME' : os.environ['HOME'] 'HOME' : os.environ['HOME']
}, },
BUILDERS = builders, BUILDERS = builders,
DESCRIPTION = description,
SUMMARY=description,
LICENSE = license,
NAME = name,
VERSION = version,
) )
# verbose compile
verbose = ARGUMENTS.get('verbose', False)
if not verbose:
env['CCCOMSTR'] = "Compiling $TARGET"
env['CXXCOMSTR'] = "Compiling $TARGET"
env['ARCOMSTR'] = " ar $TARGER"
env['LINKCOMSTR'] = "Linking $TARGET"
Export('env') Export('env')
Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5)
# die on unknown variables
unknown = vars.UnknownVariables()
if unknown:
print "Unknown variables:", unknown.keys()
Exit(1)
#generate help
Help(vars.GenerateHelpText(env))
for subdir in dirs: for subdir in dirs:
SConscript( SConscript(
subdir + os.sep + 'SConscript', subdir + os.sep + 'SConscript',