dolphin/Source/Core/DolphinWX/Src/SConscript
Soren Jorvang a22d807bf0 Try to fix Windows build.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6968 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-29 14:58:32 +00:00

144 lines
3.8 KiB
Python

# -*- python -*-
Import('env')
import os
import sys
from SconsTests import utils
files = [
'BootManager.cpp',
]
libs = [
'core',
'audiocommon', 'common', 'discio', 'inputcommon',
'GLEW', 'SOIL', 'bdisasm', 'lua', 'lzo2', 'sfml-network', 'z',
]
wxlibs = [ ]
ldflags = [ ]
if env['HAVE_WX']:
files += [
'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',
'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',
]
wxlibs += [ 'debwx', 'debugger_ui_util' ]
else:
files += [
'MainNoGUI.cpp',
]
if sys.platform == 'win32':
files += [ "stdafx.cpp" ]
elif sys.platform == 'darwin':
libs += [ 'iconv' ]
ldflags += [ '-Wl,-force_load,' + env['libvideo'][0].path ]
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:
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' ]
ldflags += [ '-Wl,--whole-archive,' + env['libvideo'][0].path ]
ldflags += [ '-Wl,--no-whole-archive' ]
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']
env.Depends(exe, env['libvideo'])
env.Program(exe, files, LIBS = libs, LINKFLAGS = linkflags)