Simplify the SCons build:

On OS X, build all code as Objective-C(++).

Centralize framework handling.

Cleanup.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5645 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2010-06-10 14:18:21 +00:00
parent de45e015cd
commit 404c625622
26 changed files with 110 additions and 253 deletions

View File

@ -1,4 +1,3 @@
# -*- python -*-
Import('env')
@ -11,22 +10,19 @@ files = [
'AudioCommon.cpp',
]
acenv = env.Clone()
if acenv['HAVE_OPENAL']:
if env['HAVE_OPENAL']:
files += [ 'OpenALStream.cpp', 'aldlist.cpp' ]
if acenv['HAVE_AO']:
if env['HAVE_AO']:
files += [ 'AOSoundStream.cpp' ]
if acenv['HAVE_ALSA']:
if env['HAVE_ALSA']:
files += [ 'AlsaSoundStream.cpp' ]
if acenv['HAVE_PULSEAUDIO']:
if env['HAVE_PULSEAUDIO']:
files += [ 'PulseAudioStream.cpp' ]
if sys.platform == 'darwin':
files += [ 'CoreAudioSoundStream.cpp' ]
acenv['FRAMEWORKS'] = [ 'CoreAudio', 'AudioUnit' ]
acenv.StaticLibrary(env['local_libs'] + 'audiocommon', files)
env.StaticLibrary(env['local_libs'] + 'audiocommon', files)

View File

@ -47,5 +47,4 @@ if sys.platform == 'win32':
files += [ "ExtendedTrace.cpp" ]
files += [ "stdafx.cpp" ]
env_common = env.Clone()
env_common.StaticLibrary(env['local_libs'] + "common", files)
env.StaticLibrary(env['local_libs'] + "common", files)

View File

@ -25,9 +25,7 @@ files = [
"DSPTables.cpp",
"Jit/DSPJitExtOps.cpp",
"Jit/DSPJitUtil.cpp",
"Jit/DSPJitMisc.cpp",
"Jit/DSPJitMisc.cpp",
]
acenv = env.Clone()
acenv.StaticLibrary(env['local_libs'] + 'dspcore', files, LIBS = [ 'common'] )
env.StaticLibrary(env['local_libs'] + 'dspcore', files)

View File

@ -12,6 +12,4 @@ files = [
'MemoryView.cpp',
]
acenv = env.Clone()
acenv.StaticLibrary(env['local_libs'] + 'debugger_ui_util', files)
env.StaticLibrary(env['local_libs'] + 'debugger_ui_util', files)

View File

@ -23,7 +23,6 @@
#include <wx/textctrl.h>
#include <wx/listbox.h>
#include <wx/artprov.h>
#include <wx/aui/aui.h>
#include "Thread.h"
#include "CoreParameter.h"

View File

@ -17,15 +17,14 @@ files = [
"RegisterView.cpp",
"JitWindow.cpp",
]
wxenv = env.Clone()
wxenv.Append(
CPPDEFINES = [
'wxNEEDS_CHARPP'
],
LINKFLAGS = [
'-pthread',
]
)
libs = [
'common',
'debugger_ui_util'

View File

@ -26,7 +26,4 @@ files = [
'AES/aes_cbc.c',
'AES/aes_core.c',
]
libs = [
'common'
]
env.StaticLibrary(env['local_libs'] + 'discio', files, LIBS = libs)

View File

@ -43,9 +43,9 @@ if wxenv['HAVE_WX']:
'NetWindow.cpp',
]
CPPDEFINES = [
'wxNEEDS_CHARPP',
],
CPPDEFINES = [
'wxNEEDS_CHARPP',
],
libs = [ 'debwx', 'debugger_ui_util'] + libs
else:
@ -54,34 +54,11 @@ else:
]
if sys.platform == 'darwin':
files += [ 'cocoaApp.m', ]
compileFlags = [
'-x',
'objective-c++',
]
wxenv.Append(
CXXFLAGS = compileFlags,
LINKFLAGS = [
'-pthread', '-framework', 'IOKit'
],
LIBS = libs
)
else:
wxenv.Append(
LINKFLAGS = [
'-pthread',
],
LIBS = libs
)
files += [ 'cocoaApp.m', ]
if sys.platform == 'darwin':
exeGUI = env['binary_dir'] + 'Dolphin.app/Contents/MacOS/Dolphin'
exeNoGUI = env['binary_dir'] + 'DolphinNoGUI'
wxenv['FRAMEWORKS'] = ['Cocoa', 'CoreFoundation', 'System']
wxenv.Plist(
env['binary_dir'] + 'Dolphin.app/Contents/Info.plist',
Value(dict(
@ -100,11 +77,13 @@ else:
exeGUI = env['binary_dir'] + 'dolphin-emu'
exeNoGUI = env['binary_dir'] + 'dolphin-emu-nogui'
wxenv.Append(
LIBS = libs
)
if wxenv['HAVE_X11']:
files += [ 'X11Utils.cpp' ]
#objects = [ wxenv.Object(srcFile) for srcFile in files ]
if wxenv['HAVE_WX']:
wxenv.Program(exeGUI, files + [ 'Main.cpp' ])
else:

View File

@ -102,11 +102,11 @@ bool EventHandler::TestEvent (Keys k, sf::Event e)
#if defined HAVE_WX && HAVE_WX
// Taken from wxw source code
sf::Key::Code EventHandler::wxCharCodeToSF(int id)
sf::Key::Code EventHandler::wxCharCodeToSF(int charcode)
{
sf::Key::Code sfKey;
switch (id) {
switch (charcode) {
// case WXK_CANCEL: sfKey = sf::Key::Cancel; break;
// case WXK_BACK: sfKey = sf::Key::BackSpace; break;
case WXK_TAB: sfKey = sf::Key::Tab; break;
@ -181,12 +181,12 @@ sf::Key::Code EventHandler::wxCharCodeToSF(int id)
default:
// To lower (will tolower work on windows?)
if (id >= 'A' && id <= 'Z')
id = id - 'A' + 'a';
if (charcode >= 'A' && charcode <= 'Z')
charcode = charcode - 'A' + 'a';
if ((id >= 'a' && id <= 'z') ||
(id >= '0' && id <= '9'))
sfKey = (sf::Key::Code)id;
if ((charcode >= 'a' && charcode <= 'z') ||
(charcode >= '0' && charcode <= '9'))
sfKey = (sf::Key::Code)charcode;
else
sfKey = sf::Key::Count; // Invalid key

View File

@ -1,7 +1,6 @@
# -*- python -*-
import sys
Import('env')
icenv = env.Clone()
files = [
'Configuration.cpp',
@ -21,7 +20,7 @@ if env['HAVE_WX']:
"WXInputBase.cpp",
]
if icenv['HAVE_SDL']:
if env['HAVE_SDL']:
files += [
'ControllerInterface/SDL/SDL.cpp'
]
@ -32,11 +31,10 @@ if sys.platform == 'darwin':
'ControllerInterface/OSX/OSXKeyboard.mm',
'ControllerInterface/OSX/OSXMouse.mm'
]
icenv['FRAMEWORKS'] = ['IOKit']
if sys.platform == 'linux2':
files += [
'ControllerInterface/Xlib/Xlib.cpp'
]
icenv.StaticLibrary(env['local_libs'] + "inputcommon", files)
env.StaticLibrary(env['local_libs'] + "inputcommon", files)

View File

@ -37,12 +37,9 @@ files = [
'HiresTextures.cpp',
]
env_vcommon = env.Clone()
if env_vcommon['HAVE_OPENCL']:
if env['HAVE_OPENCL']:
files += [
'OpenCL/OCLTextureDecoder.cpp',
]
env_vcommon.StaticLibrary(env['local_libs'] + "videocommon", files)
env.StaticLibrary(env['local_libs'] + "videocommon", files)