From 6a426c165448b295aa6f7ac9ebe292f905811ff6 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Tue, 26 Aug 2008 00:18:00 +0000 Subject: [PATCH] Cleanup and refactoring. Only the platform specific parts are in a platform specific block now, the rest is shared instead of duplicated. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@316 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/SConscript | 87 +++++++++++++------ 1 file changed, 59 insertions(+), 28 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/SConscript b/Source/Plugins/Plugin_VideoOGL/Src/SConscript index 5a481c57e9..8e0627fed6 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/SConscript +++ b/Source/Plugins/Plugin_VideoOGL/Src/SConscript @@ -1,32 +1,63 @@ Import('env') import sys -files = ["BPStructs.cpp", - "DataReader.cpp", - "Globals.cpp", - "GLInit.cpp", - "main.cpp", - "memcpy_amd.cpp", - "OpcodeDecoding.cpp", -# "OpcodeReaders.cpp", # outdated - "PixelShader.cpp", - "PixelShaderManager.cpp", - "rasterfont.cpp", - "Render.cpp", -# "TextureDecoder.cpp", - "TextureMngr.cpp", - "VertexLoader.cpp", - "VertexLoader_Normal.cpp", - "VertexShader.cpp", - "VertexShaderManager.cpp", - "XFB.cpp", -# "Linux/Conf.cpp", -# "Linux/Linux.cpp", - "GUI/ConfigDlg.cpp", - ] -if sys.platform == 'darwin': - gfxenv=env.Copy(CXXFLAGS = " `sdl-config --cflags` `wx-config --cppflags` -I/opt/local/include ", LINKFLAGS = " -framework OpenGL -framework Cg `sdl-config --libs` `wx-config --libs` -L/opt/local/lib ") - gfxenv.SharedLibrary("../../../../Binary/mac/Plugins/zeroogl.so", files, LIBS=["videocommon", "common", "GLEW", "jpeg"]) +files = [ + 'BPStructs.cpp', + 'DataReader.cpp', + 'Globals.cpp', + 'GLInit.cpp', + 'main.cpp', + 'memcpy_amd.cpp', + 'OpcodeDecoding.cpp', +# 'OpcodeReaders.cpp', # outdated + 'PixelShader.cpp', + 'PixelShaderManager.cpp', + 'rasterfont.cpp', + 'Render.cpp', + 'TextureMngr.cpp', + 'VertexLoader.cpp', + 'VertexLoader_Normal.cpp', + 'VertexShader.cpp', + 'VertexShaderManager.cpp', + 'XFB.cpp', + 'GUI/ConfigDlg.cpp', + ] +compileFlags = [ + '`wx-config --cppflags`', + ] +linkFlags = [ + '`wx-config --libs`', + ] +libs = [ + 'videocommon', 'common', 'GLEW', 'jpeg', + ] +if sys.platform == 'darwin': + platform = 'mac' + # Use libraries from MacPorts. + compileFlags.append('-I/opt/local/include') + linkFlags.append('-L/opt/local/lib') + # Use SDL. + compileFlags.append('`sdl-config --cflags`') + linkFlags.append('`sdl-config --libs`') + # Use frameworks instead of plain libs, when possible. + linkFlags += [ + '-framework %s' % framework + for framework in [ 'OpenGL', 'Cg' ] + ] else: - gfxenv=env.Copy(CXXFLAGS = " `wx-config --cppflags` `pkg-config --cflags xxf86vm` ", LINKFLAGS = "`wx-config --libs` `pkg-config --libs xxf86vm` ") - gfxenv.SharedLibrary("../../../../Binary/linux/Plugins/zeroogl.so", files, LIBS=["videocommon", "common", "cairo", "GL", "GLU", "GLEW", "CgGL", "Cg", "X11"]) + platform = 'linux' + # Libraries with pkg-config support. + compileFlags.append('`pkg-config --cflags xxf86vm`') + linkFlags.append('`pkg-config --libs xxf86vm`') + # Libraries without pkg-config support. + libs += [ 'GL', 'Cg', 'CgGL', 'X11' ] + +gfxenv = env.Copy( + CXXFLAGS = ' '.join(compileFlags), + LINKFLAGS = ' '.join(linkFlags), + ) +gfxenv.SharedLibrary( + '../../../../Binary/%s/Plugins/zeroogl.so' % platform, + files, + LIBS = libs + )