dolphin/Source/Core/DolphinWX/Src/SConscript
Soren Jorvang 98e24f5873 The compiler need not obey the static keyword, so to avoid linker
problems, whole functions in .h files need to also be static in
case they are included in several .cpp files.

Also a few other minor LTO fixes.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7082 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-05 16:06:05 +00:00

127 lines
3.5 KiB
Python

# -*- 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':
env['CPPPATH'] += ['#Externals']
env['FRAMEWORKPATH'] += ['Externals/Cg']
frameworksflags += ['-Wl,-weak_framework,Cg']
frameworksflags += ['-Wl,-weak_framework,OpenCL']
frameworksflags += ['-Wl,-weak_framework,QuickTime']
frameworksflags += ['-Wl,-no_arch_warnings']
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)