118 lines
2.4 KiB
Python
118 lines
2.4 KiB
Python
# -*- python -*-
|
|
|
|
Import('env')
|
|
# can we import path in one place?
|
|
import sys
|
|
sys.path.append(env['base_dir']+'SconsTests')
|
|
import utils
|
|
import platform
|
|
|
|
name = "Plugin_VideoOGL"
|
|
|
|
files = [
|
|
'BPStructs.cpp',
|
|
'Globals.cpp',
|
|
'GLUtil.cpp',
|
|
'main.cpp',
|
|
'Config.cpp',
|
|
'memcpy_amd.cpp',
|
|
'OpcodeDecoding.cpp',
|
|
'PixelShaderManager.cpp',
|
|
'rasterfont.cpp',
|
|
'Render.cpp',
|
|
'TextureMngr.cpp',
|
|
'ImageWrite.cpp',
|
|
'NativeVertexFormat.cpp',
|
|
'VertexManager.cpp',
|
|
'VertexLoader.cpp',
|
|
'VertexLoader_Color.cpp',
|
|
'VertexLoader_Normal.cpp',
|
|
'VertexLoader_Position.cpp',
|
|
'VertexLoader_TextCoord.cpp',
|
|
'VertexLoaderManager.cpp',
|
|
'VertexShaderManager.cpp',
|
|
'TextureConverter.cpp',
|
|
'XFB.cpp',
|
|
'Logging/Console.cpp',
|
|
'Logging/Logging.cpp',
|
|
]
|
|
compileFlags = [
|
|
'-fPIC',
|
|
]
|
|
linkFlags = [
|
|
]
|
|
libs = [
|
|
'videocommon', 'common',
|
|
]
|
|
|
|
gfxenv = env.Clone()
|
|
|
|
if gfxenv['HAVE_WX']:
|
|
files += [
|
|
'GUI/ConfigDlg.cpp',
|
|
'Debugger/Debugger.cpp',
|
|
'Debugger/PBView.cpp',
|
|
]
|
|
|
|
if gfxenv['osx64']:
|
|
files += [ 'cocoaGL.m' ]
|
|
compileFlags += [
|
|
'-x',
|
|
'objective-c++',
|
|
]
|
|
|
|
|
|
|
|
tests = {'CheckPKG' : utils.CheckPKG}
|
|
conf = gfxenv.Configure(custom_tests = tests,
|
|
config_h="Source/Core/Common/Src/Config.h")
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
# Use libraries from MacPorts.
|
|
compileFlags.append('-I/opt/local/include')
|
|
linkFlags.append('-L/opt/local/lib')
|
|
conf.CheckPKG('cocoa')
|
|
conf.CheckPKG('OpenGL')
|
|
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 not conf.CheckPKG('GLEW'):
|
|
print name + " must have glew to be build"
|
|
Return()
|
|
|
|
# check for xxf86vm
|
|
|
|
gfxenv['HAVE_XXF86VM'] = conf.CheckPKG('xxf86vm')
|
|
conf.Define('HAVE_XXF86VM', gfxenv['HAVE_XXF86VM'])
|
|
|
|
conf.Finish()
|
|
|
|
# change to True if you want to compile with SDL
|
|
useSDL = not (gfxenv['HAVE_X11'] and gfxenv['HAVE_XXF86VM'])
|
|
|
|
|
|
if useSDL and not gfxenv['HAVE_SDL']:
|
|
print name + " must have either X11 or sdl to be build"
|
|
Return()
|
|
|
|
if useSDL:
|
|
compileFlags += [ '-DUSE_SDL=1' ]
|
|
|
|
gfxenv.Append(
|
|
CXXFLAGS = compileFlags,
|
|
LINKFLAGS = linkFlags,
|
|
)
|
|
|
|
gfxenv.SharedLibrary(
|
|
env['plugin_dir']+name,
|
|
files,
|
|
LIBS = libs + gfxenv['LIBS']
|
|
)
|