2008-09-21 19:54:29 +00:00
|
|
|
# -*- python -*-
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
Import('env')
|
2008-09-24 17:47:51 +00:00
|
|
|
# can we import path in one place?
|
2008-08-06 21:07:31 +00:00
|
|
|
import sys
|
2008-11-13 08:12:48 +00:00
|
|
|
sys.path.append(env['base_dir']+'SconsTests')
|
2008-09-24 17:47:51 +00:00
|
|
|
import utils
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-11-13 08:12:48 +00:00
|
|
|
name = "Plugin_VideoOGL"
|
2008-11-11 20:59:48 +00:00
|
|
|
|
2008-08-26 00:18:00 +00:00
|
|
|
files = [
|
|
|
|
'BPStructs.cpp',
|
|
|
|
'Globals.cpp',
|
2008-10-22 21:02:37 +00:00
|
|
|
'GLUtil.cpp',
|
2008-08-26 00:18:00 +00:00
|
|
|
'main.cpp',
|
2008-10-22 21:23:40 +00:00
|
|
|
'Config.cpp',
|
2008-08-26 00:18:00 +00:00
|
|
|
'memcpy_amd.cpp',
|
|
|
|
'OpcodeDecoding.cpp',
|
|
|
|
'PixelShaderManager.cpp',
|
|
|
|
'rasterfont.cpp',
|
|
|
|
'Render.cpp',
|
|
|
|
'TextureMngr.cpp',
|
2008-10-17 11:30:14 +00:00
|
|
|
'ImageWrite.cpp',
|
2008-10-24 23:08:46 +00:00
|
|
|
'NativeVertexFormat.cpp',
|
2008-10-17 11:30:14 +00:00
|
|
|
'VertexManager.cpp',
|
2008-08-26 00:18:00 +00:00
|
|
|
'VertexLoader.cpp',
|
2008-11-30 15:06:34 +00:00
|
|
|
'VertexLoader_Color.cpp',
|
2008-08-26 00:18:00 +00:00
|
|
|
'VertexLoader_Normal.cpp',
|
2008-11-30 15:06:34 +00:00
|
|
|
'VertexLoader_Position.cpp',
|
|
|
|
'VertexLoader_TextCoord.cpp',
|
2008-10-25 12:35:55 +00:00
|
|
|
'VertexLoaderManager.cpp',
|
2008-08-26 00:18:00 +00:00
|
|
|
'VertexShaderManager.cpp',
|
2008-11-11 07:31:40 +00:00
|
|
|
'TextureConverter.cpp',
|
2008-08-26 00:18:00 +00:00
|
|
|
'XFB.cpp',
|
2008-10-10 16:20:13 +00:00
|
|
|
'Logging/Console.cpp',
|
|
|
|
'Logging/Logging.cpp',
|
2008-08-26 00:18:00 +00:00
|
|
|
]
|
|
|
|
compileFlags = [
|
2008-08-26 22:28:42 +00:00
|
|
|
'-fPIC',
|
2008-08-26 00:18:00 +00:00
|
|
|
]
|
|
|
|
linkFlags = [
|
|
|
|
]
|
|
|
|
libs = [
|
2008-08-29 09:55:17 +00:00
|
|
|
'videocommon', 'common', 'GLEW',
|
2008-08-26 00:18:00 +00:00
|
|
|
]
|
2008-09-20 22:06:22 +00:00
|
|
|
|
|
|
|
gfxenv = env.Clone()
|
|
|
|
|
2008-12-05 13:46:19 +00:00
|
|
|
if gfxenv['HAVE_WX']:
|
2008-10-25 17:47:46 +00:00
|
|
|
files += [
|
2008-12-05 13:46:19 +00:00
|
|
|
'GUI/ConfigDlg.cpp',
|
|
|
|
'Debugger/Debugger.cpp',
|
|
|
|
'Debugger/PBView.cpp',
|
|
|
|
]
|
2008-10-25 17:47:46 +00:00
|
|
|
|
|
|
|
if gfxenv['osx64']:
|
|
|
|
files += [ 'cocoaGL.m' ]
|
|
|
|
compileFlags += [
|
|
|
|
'-x',
|
|
|
|
'objective-c++',
|
|
|
|
]
|
|
|
|
linkFlags += [
|
|
|
|
'-framework',
|
|
|
|
'cocoa',
|
|
|
|
'-arch',
|
|
|
|
'x86_64'
|
|
|
|
]
|
|
|
|
|
2008-12-06 22:28:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tests = {'CheckPKG' : utils.CheckPKG}
|
|
|
|
conf = gfxenv.Configure(custom_tests = tests)
|
|
|
|
|
2008-12-07 19:13:44 +00:00
|
|
|
if not (conf.CheckPKG('gl') and conf.CheckPKG('glu')):
|
|
|
|
print name + " must have opengl (gl and glu) to be build"
|
2008-12-06 22:28:32 +00:00
|
|
|
Return()
|
|
|
|
|
|
|
|
|
|
|
|
# check for xxf86vm
|
|
|
|
|
|
|
|
gfxenv['HAVE_XXF86VM'] = conf.CheckPKG('xxf86vm')
|
|
|
|
|
|
|
|
gfxenv = conf.Finish()
|
|
|
|
|
|
|
|
if gfxenv['HAVE_XXF86VM']:
|
|
|
|
gfxenv.ParseConfig("pkg-config xxf86vm --cflags --libs")
|
|
|
|
|
|
|
|
gfxenv.ParseConfig("pkg-config gl --cflags --libs")
|
2008-12-07 19:13:44 +00:00
|
|
|
gfxenv.ParseConfig("pkg-config glu --cflags --libs")
|
2008-12-05 13:46:19 +00:00
|
|
|
|
2008-08-26 00:18:00 +00:00
|
|
|
if sys.platform == 'darwin':
|
2008-12-05 13:46:19 +00:00
|
|
|
|
2008-08-26 00:18:00 +00:00
|
|
|
# Use libraries from MacPorts.
|
|
|
|
compileFlags.append('-I/opt/local/include')
|
|
|
|
linkFlags.append('-L/opt/local/lib')
|
|
|
|
# Use frameworks instead of plain libs, when possible.
|
|
|
|
linkFlags += [
|
2008-09-23 00:11:33 +00:00
|
|
|
'-Wl,-framework,%s' % framework
|
2008-12-06 22:28:32 +00:00
|
|
|
for framework in [ 'Cg' ]
|
2008-08-26 00:18:00 +00:00
|
|
|
]
|
2008-08-06 21:07:31 +00:00
|
|
|
else:
|
2008-12-06 22:28:32 +00:00
|
|
|
# Libraries without pkg-config support.
|
|
|
|
libs += [ 'Cg', 'CgGL' ]
|
2008-12-05 13:46:19 +00:00
|
|
|
|
2008-09-20 22:06:22 +00:00
|
|
|
|
2008-12-06 22:28:32 +00:00
|
|
|
# change to True if you want to compile with SDL
|
|
|
|
useSDL = not (gfxenv['HAVE_X11'] and gfxenv['HAVE_XXF86VM'])
|
2008-08-26 00:18:00 +00:00
|
|
|
|
2008-10-28 14:19:28 +00:00
|
|
|
|
2008-12-06 22:28:32 +00:00
|
|
|
if useSDL and not gfxenv['HAVE_SDL']:
|
|
|
|
print name + " must have either X11 or sdl to be build"
|
|
|
|
Return()
|
2008-10-28 14:19:28 +00:00
|
|
|
|
2008-09-20 22:06:22 +00:00
|
|
|
if useSDL:
|
|
|
|
compileFlags += [ '-DUSE_SDL=1' ]
|
2008-08-26 00:57:16 +00:00
|
|
|
|
2008-08-26 22:28:42 +00:00
|
|
|
gfxenv.Append(
|
2008-09-20 22:06:22 +00:00
|
|
|
CXXFLAGS = compileFlags,
|
2008-09-23 00:11:33 +00:00
|
|
|
LINKFLAGS = linkFlags,
|
2008-08-26 00:18:00 +00:00
|
|
|
)
|
2008-09-20 22:06:22 +00:00
|
|
|
|
2008-10-25 17:47:46 +00:00
|
|
|
gfxenv.SharedLibrary(
|
2008-11-13 08:12:48 +00:00
|
|
|
env['plugin_dir']+name,
|
2008-08-26 00:18:00 +00:00
|
|
|
files,
|
2008-10-28 14:19:28 +00:00
|
|
|
LIBS = libs + gfxenv['LIBS']
|
2008-08-26 00:18:00 +00:00
|
|
|
)
|