dolphin/Source/Core/DolphinWX/Src/SConscript

124 lines
3.4 KiB
Python
Raw Normal View History

# -*- python -*-
Import('env')
import os
import sys
from SconsTests import utils
files = ['BootManager.cpp']
frameworksflags = []
if not env['HAVE_WX']:
files += ['MainNoGUI.cpp']
else:
files += [
'AboutDolphin.cpp',
'ARCodeAddEdit.cpp',
'GeckoCodeDiag.cpp',
'ConfigMain.cpp',
'Frame.cpp',
'FrameAui.cpp',
'FrameTools.cpp',
'LogWindow.cpp',
'GameListCtrl.cpp',
'HotkeyDlg.cpp',
'InputConfigDiag.cpp',
'InputConfigDiagBitmaps.cpp',
'ISOFile.cpp',
'ISOProperties.cpp',
'PatchAddEdit.cpp',
'PHackSettings.cpp',
'CheatsWindow.cpp',
'Main.cpp',
'MemcardManager.cpp',
'MemoryCards/GCMemcard.cpp',
'MemoryCards/WiiSaveCrypted.cpp',
'NetPlay.cpp',
'NetPlayClient.cpp',
'NetPlayServer.cpp',
'NetWindow.cpp',
'UDPConfigDiag.cpp',
'WiimoteConfigDiag.cpp',
'WXInputBase.cpp',
'WxUtils.cpp',
]
if sys.platform == 'win32':
files += ["stdafx.cpp"]
elif sys.platform == 'darwin':
frameworksflags += ['-Wl,-framework,QuickTime', '-Wl,-no_arch_warnings']
frameworksflags += ['-weak_framework', 'OpenCL']
exe = '#' + env['prefix'] + '/Dolphin.app/Contents/MacOS/Dolphin'
if env['HAVE_WX']:
env['LIBS'] += env['wxconfiglibs']
else:
env['LIBS'] += ['iconv']
exe += 'NoGUI'
env.Install('#' + env['prefix'] + '/Dolphin.app/Contents/' +
'Frameworks/Cg.framework', source = [
'#Externals/Cg/Cg.framework/Cg',
'#Externals/Cg/Cg.framework/Resources'
])
env.Install(env['data_dir'], '#Data/Sys')
env.Install(env['data_dir'], '#Data/User')
env.Install(env['data_dir'],
'#Source/Core/DolphinWX/resources/Dolphin.icns')
languages = []
msgfmt = env.WhereIs('msgfmt')
if not msgfmt == None:
po_files = Glob('#Languages/*.po', strings = True)
for po in po_files:
index_lo = po.find('Languages/') + len('Languages/')
index_hi = po.find('.po')
lang = po[index_lo:index_hi]
lproj = os.sep + lang + '.lproj'
mo_dir = env['build_dir'] + '/Languages' + lproj
mo_file = mo_dir + '/dolphin-emu.mo'
env.Command('#' + mo_file, po, 'mkdir -p ' + mo_dir +
' && ' + msgfmt + ' -o ' + mo_file + ' ' + po)
env.Install(env['data_dir'] + lproj, '#' + mo_file)
languages += [lang]
from plistlib import writePlist
def createPlist(target, source, env):
for srcNode in source:
writePlist(srcNode.value, str(target[0]))
env.Append(BUILDERS = {'Plist' : Builder(action = createPlist)})
env.Plist('#' + env['prefix'] + '/Dolphin.app/Contents/Info.plist',
Value(dict(
CFBundleExecutable = 'Dolphin',
CFBundleIconFile = 'Dolphin.icns',
CFBundleIdentifier = 'com.dolphin-emulator.dolphin',
CFBundleLocalizations = languages,
CFBundlePackageType = 'APPL',
CFBundleShortVersionString =
utils.GenerateRevFile('', Dir('#None').abspath, None),
CFBundleVersion = '3.0',
LSMinimumSystemVersion = '10.5.4',
LSRequiresCarbon = True,
CFBundleDocumentTypes = [
dict(CFBundleTypeExtensions =
('ciso', 'dol', 'elf', 'gcm', 'gcz', 'iso', 'wad'),
CFBundleTypeIconFile = 'Dolphin.icns',
CFBundleTypeName = 'Nintendo GC/Wii file',
CFBundleTypeRole = 'Viewer')]
)))
else:
files += ['X11Utils.cpp']
exe = env['binary_dir'] + '/dolphin-emu'
if not env['HAVE_WX']:
exe += '-nogui'
env.InstallAs(env['data_dir'] + '/sys', '#Data/Sys')
env.InstallAs(env['data_dir'] + '/user', '#Data/User')
env.Command('dummy', '#' + env['prefix'],
"find $SOURCES -name .svn -exec rm -rf {} +")
env.Program(exe, files, FRAMEWORKSFLAGS = frameworksflags)