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

@ -33,7 +33,5 @@ if dspenv['HAVE_WX']:
dspenv.Append(
LIBS = [ 'common', 'audiocommon' ],
)
if sys.platform == 'darwin':
dspenv['FRAMEWORKS'] = [ 'CoreAudio', 'CoreServices', 'AudioUnit' ]
dspenv.SharedLibrary(env['plugin_dir']+name, files)

View File

@ -33,6 +33,10 @@
#include <wx/sizer.h>
#include <wx/listctrl.h>
#include <wx/statline.h>
#if defined(__APPLE__)
//id is an objective-c++ type, wx team need to change this
#define id toolid
#endif
#include <wx/aui/aui.h>
#include "disassemble.h"

View File

@ -24,14 +24,14 @@ if env['HAVE_WX']:
]
lleenv = env.Clone()
if env['HAVE_WX']:
lleenv.Append(
LIBS = [ 'dspcore', 'audiocommon', 'common', 'debugger_ui_util' ],
LIBS = [ 'dspcore', 'audiocommon', 'common', 'debugger_ui_util' ],
)
else:
lleenv.Append(
LIBS = [ 'dspcore', 'audiocommon', 'common' ],
)
if sys.platform == 'darwin':
lleenv['FRAMEWORKS'] = [ 'CoreAudio', 'CoreServices', 'AudioUnit' ]
lleenv.SharedLibrary(env['plugin_dir']+name, files)

View File

@ -15,6 +15,7 @@ files = [
'GCPad.cpp',
'Rumble.cpp',
]
if padenv['HAVE_WX']:
files += [
'ConfigJoypad.cpp',
@ -25,7 +26,4 @@ padenv.Append(
LIBS = [ 'inputcommon', 'common', ],
)
if sys.platform == 'darwin':
padenv['FRAMEWORKS'] = ['CoreFoundation', 'System' ]
padenv.SharedLibrary(env['plugin_dir']+name, files)

View File

@ -15,7 +15,4 @@ padenv.Append(
LIBS = [ 'inputplugincommon', 'inputcommon', 'common' ],
)
if sys.platform == 'darwin':
padenv['FRAMEWORKS'] = ['CoreFoundation', 'System', 'Cocoa', 'IOKit' ]
padenv.SharedLibrary(env['plugin_dir']+name, files)

View File

@ -25,8 +25,6 @@ files = [
'PostProcessing.cpp',
'FramebufferManager.cpp',
]
compileFlags = [
]
linkFlags = [
]
libs = [
@ -50,45 +48,10 @@ if gfxenv['HAVE_WX']:
if sys.platform == 'darwin':
files += [ 'cocoaGL.m' ]
compileFlags += [
'-x',
'objective-c++',
]
if sys.platform == 'win32':
files += [ 'OS/Win32.cpp' ]
tests = {'CheckPKG' : utils.CheckPKG}
conf = gfxenv.Configure(custom_tests = tests,
config_h=env['base_dir']+"Source/Core/Common/Src/Config.h")
if sys.platform == 'darwin':
gfxenv['FRAMEWORKS'] = ['CoreFoundation', 'System', 'OpenGL', 'Cocoa', 'Cg']
if gfxenv['HAVE_OPENCL']:
gfxenv['FRAMEWORKS'] += ['OpenCL']
conf.CheckPKG('OpenGL')
if not conf.CheckPKG('Cg'):
print name + " must have Cg framework from nvidia to be build"
Return()
elif sys.platform == 'win32':
print name + " is assuming that you have opengl, glu, cg, and cggl"
else:
if not (conf.CheckPKG('GL') and conf.CheckPKG('GLU')):
print name + " must have opengl and glu to be build"
Return()
if not conf.CheckPKG('Cg') or not conf.CheckPKG('CgGL'):
print name + " must have cg and cggl to be build"
Return()
if sys.platform == 'win32':
print name + " is assuming that you have glew"
else:
if not conf.CheckPKG('GLEW'):
print name + " must have glew to be build"
Return()
if sys.platform == 'win32':
files += [
'OS/Win32.cpp'
@ -98,16 +61,10 @@ if sys.platform == 'win32':
]
gfxenv['CPPPATH'] += libs
conf.Finish()
# Sanity check
if gfxenv['USE_WX'] and not gfxenv['HAVE_WX']:
print "Must have wx to use wxgl"
Return()
gfxenv.Append(
CXXFLAGS = compileFlags,
LINKFLAGS = linkFlags,
)
gfxenv.SharedLibrary(
env['plugin_dir']+name,

View File

@ -47,34 +47,9 @@ gfxenv = env.Clone()
if sys.platform == 'win32':
files += [ 'Win32.cpp' ]
tests = {'CheckPKG' : utils.CheckPKG}
conf = gfxenv.Configure(custom_tests = tests,
config_h=env['base_dir']+"Source/Core/Common/Src/Config.h")
if sys.platform == 'darwin':
gfxenv['FRAMEWORKS'] = ['CoreFoundation', 'System', 'OpenGL', 'Cocoa', 'Cg']
compileFlags = ['-x','objective-c++',]
files += [ 'cocoaGL.m', ]
conf.CheckPKG('OpenGL')
if gfxenv['HAVE_OPENCL']:
gfxenv['FRAMEWORKS'] += ['OpenCL']
elif sys.platform == 'win32':
print name + " is assuming that you have opengl, glu, cg, and cggl"
else:
if not (conf.CheckPKG('GL') and conf.CheckPKG('GLU')):
print name + " must have opengl and glu to be build"
Return()
if sys.platform == 'win32':
print name + " is assuming that you have glew"
else:
if not conf.CheckPKG('GLEW'):
print name + " must have glew to be build"
Return()
if sys.platform == 'win32':
files += [
'Win32.cpp'
@ -84,15 +59,10 @@ if sys.platform == 'win32':
]
gfxenv['CPPPATH'] += libs
conf.Finish()
# Sanity check
if gfxenv['USE_WX'] and not gfxenv['HAVE_WX']:
print "Must have wx to use wxgl"
Return()
gfxenv.Append(
LINKFLAGS = linkFlags,
)
gfxenv.SharedLibrary(
env['plugin_dir']+name,

View File

@ -19,6 +19,7 @@ files = [
"Rumble.cpp",
"UDPWiimote.cpp"
]
if wmenv['HAVE_WX']:
files += [
"ConfigBasicDlg.cpp",
@ -28,27 +29,20 @@ if wmenv['HAVE_WX']:
"ConfigRecording.cpp",
"FillReport.cpp",
]
libs = [ 'common', 'inputcommon' ]
cxxflags = [ ]
if wmenv['HAVE_WIIUSE']:
libs += [ 'wiiuse' ]
files += [ "wiimote_real.cpp" ]
files += [ "ReadWiimote.cpp" ]
cxxflags += ['-DHAVE_WIIUSE']
libs += [ 'wiiuse' ]
files += [ "wiimote_real.cpp" ]
files += [ "ReadWiimote.cpp" ]
cxxflags += ['-DHAVE_WIIUSE']
if sys.platform == 'darwin':
wmenv.Append(
CXXFLAGS = cxxflags,
LINKFLAGS = ['-framework', 'IOBluetooth'],
LIBS = libs,
)
wmenv['FRAMEWORKS'] = ['Cocoa', 'System']
else:
wmenv.Append(
CXXFLAGS = cxxflags,
LIBS = libs,
)
wmenv.Append(
CXXFLAGS = cxxflags,
LIBS = libs,
)
wmenv.SharedLibrary(env['plugin_dir']+name, files)

View File

@ -23,7 +23,4 @@ wiinewenv.Append(
LIBS = [ 'inputplugincommon', 'inputcommon', 'common' ],
)
if sys.platform == 'darwin':
wiinewenv['FRAMEWORKS'] = ['CoreFoundation', 'System', 'Cocoa', 'IOKit' ]
wiinewenv.SharedLibrary(env['plugin_dir']+name, files)