dolphin/Source/Core/DolphinWX/Src/SConscript

143 lines
3.8 KiB
Python
Raw Normal View History

# -*- python -*-
Import('env')
import os
import sys
from SconsTests import utils
files = ['BootManager.cpp']
# 'plugin_videosoftware',
libs = [
'core', 'discio', 'plugin_videoogl',
'audiocommon', 'common', 'inputcommon', 'videocommon',
'GLEW', 'SOIL', 'bdisasm', 'lua', 'lzo2', 'sfml-network', 'z',
]
wxlibs = [ ]
ldflags = [ ]
if not env['HAVE_WX']:
files += ['MainNoGUI.cpp']
else:
files += ['Main.cpp']
libfiles = [
'AboutDolphin.cpp',
'ARCodeAddEdit.cpp',
'GeckoCodeDiag.cpp',
'ConfigMain.cpp',
'Frame.cpp',
'FrameAui.cpp',
'FrameTools.cpp',
'LuaWindow.cpp',
'LogWindow.cpp',
'GameListCtrl.cpp',
'HotkeyDlg.cpp',
'InputConfigDiag.cpp',
'InputConfigDiagBitmaps.cpp',
'ISOFile.cpp',
'ISOProperties.cpp',
'PatchAddEdit.cpp',
'CheatsWindow.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',
]
env.StaticLibrary(env['local_libs'] + "dolphinwx", libfiles)
wxlibs += ['debwx', 'debugger_ui_util', 'dolphinwx']
if sys.platform == 'win32':
files += [ "stdafx.cpp" ]
elif sys.platform == 'darwin':
ldflags += [ '-Xarch_i386', '-Wl,-framework,QuickTime' ]
ldflags += [ '-weak_framework', 'OpenCL' ]
exe = '#' + env['prefix'] + '/Dolphin.app/Contents/MacOS/Dolphin'
if env['HAVE_WX']:
wxlibs += env['wxconfiglibs']
else:
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')
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')
lproj = os.sep + po[index_lo:index_hi] + '.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)
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',
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')]
)))
env.Command('dummy', '#' + env['prefix'],
"find $SOURCES -name .svn -exec rm -rf {} +")
else:
files += [ 'X11Utils.cpp' ]
libs += [ 'SDL', 'clrun' ]
if env['HAVE_WX']:
exe = env['binary_dir'] + '/dolphin-emu'
else:
exe = env['binary_dir'] + '/dolphin-emu-nogui'
env.InstallAs(env['data_dir'] + '/sys', '#Data/Sys')
env.InstallAs(env['data_dir'] + '/user', '#Data/User')
libs = wxlibs + libs + env['LIBS']
linkflags = ldflags + env['LINKFLAGS']
if env['HAVE_WX']:
libs += ['videouicommon']
env.Program(exe, files, LIBS = libs, LINKFLAGS = linkflags)