| 
									
										
										
										
											2009-01-15 06:48:15 +00:00
										 |  |  | # -*- python -*- | 
					
						
							| 
									
										
										
										
											2008-09-21 19:54:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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-12-09 21:46:32 +00:00
										 |  |  | import platform | 
					
						
							| 
									
										
										
										
											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:23:40 +00:00
										 |  |  | 	'Config.cpp', | 
					
						
							| 
									
										
										
										
											2008-08-26 00:18:00 +00:00
										 |  |  | 	'rasterfont.cpp', | 
					
						
							|  |  |  | 	'Render.cpp', | 
					
						
							|  |  |  | 	'TextureMngr.cpp', | 
					
						
							| 
									
										
										
										
											2008-10-24 23:08:46 +00:00
										 |  |  | 	'NativeVertexFormat.cpp', | 
					
						
							| 
									
										
										
										
											2008-12-26 11:23:59 +00:00
										 |  |  | 	'PixelShaderCache.cpp', | 
					
						
							|  |  |  | 	'VertexShaderCache.cpp', | 
					
						
							| 
									
										
										
										
											2008-11-11 07:31:40 +00:00
										 |  |  | 	'TextureConverter.cpp', | 
					
						
							| 
									
										
										
										
											2008-12-26 13:19:27 +00:00
										 |  |  | 	'VertexManager.cpp', | 
					
						
							|  |  |  | 	'VertexLoaderManager.cpp', | 
					
						
							| 
									
										
										
										
											2008-08-26 00:18:00 +00:00
										 |  |  | 	'XFB.cpp', | 
					
						
							| 
									
										
										
										
											2008-12-26 11:37:41 +00:00
										 |  |  | 	'XFStructs.cpp', | 
					
						
							| 
									
										
										
										
											2009-01-12 08:23:09 +00:00
										 |  |  | 	'TextureConversionShader.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-12-09 21:46:32 +00:00
										 |  |  | 	'videocommon', 'common', | 
					
						
							| 
									
										
										
										
											2008-08-26 00:18:00 +00:00
										 |  |  | 	] | 
					
						
							| 
									
										
										
										
											2008-09-20 22:06:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | gfxenv = env.Clone() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-19 11:46:52 +00:00
										 |  |  | if gfxenv['GLTEST']: | 
					
						
							|  |  |  | 	files += [ | 
					
						
							|  |  |  | 		'nmain.cpp', | 
					
						
							|  |  |  | 		'nGLUtil.cpp', | 
					
						
							|  |  |  | 		] | 
					
						
							| 
									
										
										
										
											2009-01-05 22:51:35 +00:00
										 |  |  | 	libs += [ 'inputcommon' ] | 
					
						
							| 
									
										
										
										
											2008-12-19 11:46:52 +00:00
										 |  |  | else: | 
					
						
							|  |  |  | 	files += [ | 
					
						
							|  |  |  | 		'main.cpp', | 
					
						
							|  |  |  | 		'GLUtil.cpp', | 
					
						
							| 
									
										
										
										
											2009-01-15 06:48:15 +00:00
										 |  |  | 		] | 
					
						
							| 
									
										
										
										
											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-12-14 23:52:01 +00:00
										 |  |  |                 'Logging/Console.cpp', | 
					
						
							|  |  |  |                 'Logging/Logging.cpp', | 
					
						
							| 
									
										
										
										
											2008-12-05 13:46:19 +00:00
										 |  |  |                 ] | 
					
						
							| 
									
										
										
										
											2008-10-25 17:47:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-10 18:33:13 +00:00
										 |  |  | if gfxenv['HAVE_COCOA']: | 
					
						
							|  |  |  |         files += [ 'cocoaGL.m' ] | 
					
						
							|  |  |  |         compileFlags +=	[ | 
					
						
							|  |  |  |                 '-x', | 
					
						
							|  |  |  |                 'objective-c++', | 
					
						
							|  |  |  |                 ] | 
					
						
							| 
									
										
										
										
											2008-12-06 22:28:32 +00:00
										 |  |  |          | 
					
						
							|  |  |  | tests = {'CheckPKG' : utils.CheckPKG} | 
					
						
							| 
									
										
										
										
											2008-12-09 21:46:32 +00:00
										 |  |  | conf = gfxenv.Configure(custom_tests = tests, | 
					
						
							| 
									
										
										
										
											2008-12-12 11:57:15 +00:00
										 |  |  |                         config_h=env['base_dir']+"Source/Core/Common/Src/Config.h") | 
					
						
							| 
									
										
										
										
											2008-12-06 22:28:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-09 21:46:32 +00:00
										 |  |  | if sys.platform == 'darwin': | 
					
						
							| 
									
										
										
										
											2008-12-09 18:10:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-09 21:46:32 +00:00
										 |  |  | 	# Use libraries from MacPorts. | 
					
						
							|  |  |  | 	compileFlags.append('-I/opt/local/include') | 
					
						
							|  |  |  | 	linkFlags.append('-L/opt/local/lib') | 
					
						
							|  |  |  |         conf.CheckPKG('OpenGL') | 
					
						
							| 
									
										
										
										
											2008-12-10 18:33:13 +00:00
										 |  |  |         if not conf.CheckPKG('Cg'): | 
					
						
							| 
									
										
										
										
											2008-12-17 15:34:27 +00:00
										 |  |  |                 print name + " must have Cg framework from nvidia to be build" | 
					
						
							|  |  |  |                 Return() | 
					
						
							| 
									
										
										
										
											2008-12-10 18:33:13 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-09 18:10:16 +00:00
										 |  |  | else: | 
					
						
							| 
									
										
										
										
											2009-01-15 06:48:15 +00:00
										 |  |  |         if not (conf.CheckPKG('GL') and conf.CheckPKG('GLU')): | 
					
						
							| 
									
										
										
										
											2008-12-09 21:46:32 +00:00
										 |  |  |                 print name + " must have opengl and glu to be build" | 
					
						
							|  |  |  |                 Return() | 
					
						
							| 
									
										
										
										
											2008-12-09 18:10:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-15 06:48:15 +00:00
										 |  |  |         if not conf.CheckPKG('Cg') or not conf.CheckPKG('CgGL'): | 
					
						
							| 
									
										
										
										
											2008-12-10 18:33:13 +00:00
										 |  |  |                 print name + " must have cg and cggl to be build" | 
					
						
							|  |  |  |                 Return() | 
					
						
							| 
									
										
										
										
											2008-12-06 22:28:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-09 21:46:32 +00:00
										 |  |  | if not conf.CheckPKG('GLEW'): | 
					
						
							|  |  |  |         print name + " must have glew to be build" | 
					
						
							|  |  |  |         Return() | 
					
						
							| 
									
										
										
										
											2008-12-06 22:28:32 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # check for xxf86vm | 
					
						
							| 
									
										
										
										
											2008-12-10 18:33:13 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | gfxenv['HAVE_XXF86VM'] = gfxenv['HAVE_X11'] and conf.CheckPKG('xxf86vm') | 
					
						
							| 
									
										
										
										
											2008-12-06 22:28:32 +00:00
										 |  |  |          | 
					
						
							| 
									
										
										
										
											2008-12-09 21:46:32 +00:00
										 |  |  | conf.Define('HAVE_XXF86VM', gfxenv['HAVE_XXF86VM']) | 
					
						
							| 
									
										
										
										
											2008-12-06 22:28:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-09 18:10:16 +00:00
										 |  |  | conf.Finish() | 
					
						
							| 
									
										
										
										
											2008-12-06 22:28:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-09 00:35:06 +00:00
										 |  |  | if gfxenv['GLTEST']: | 
					
						
							|  |  |  | 	if gfxenv['HAVE_XXF86VM']: | 
					
						
							| 
									
										
										
										
											2009-01-15 06:48:15 +00:00
										 |  |  | 		files += [ | 
					
						
							| 
									
										
										
										
											2009-01-09 00:35:06 +00:00
										 |  |  | 			'X11Window.cpp', | 
					
						
							|  |  |  | 			] | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 	if gfxenv['HAVE_SDL']: | 
					
						
							|  |  |  | 		files += [ | 
					
						
							|  |  |  | 			'SDLWindow.cpp', | 
					
						
							|  |  |  | 			] | 
					
						
							|  |  |  | 	if gfxenv['USE_WX']: | 
					
						
							|  |  |  | 		files += [ | 
					
						
							|  |  |  | 			'WXGLWindow.cpp', | 
					
						
							|  |  |  | 			] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-13 23:19:56 +00:00
										 |  |  | # Sanity check | 
					
						
							|  |  |  | if gfxenv['USE_WX'] and not gfxenv['HAVE_WX']: | 
					
						
							|  |  |  |     print "Must have wx to use wxgl" | 
					
						
							|  |  |  |     Return() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if gfxenv['USE_SDL'] and not gfxenv['HAVE_SDL']: | 
					
						
							|  |  |  |     print "Must have sdl to use SDL gl" | 
					
						
							|  |  |  |     Return() | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 	) |