From 9eb1b263129e4cfe220d838db7d42a7d5b2316b2 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 12 Jul 2011 18:39:46 +0000 Subject: [PATCH] Fix for recent GHOST SDL commit. SCons rules haven't been changed to deal with new option. --- build_files/scons/tools/btools.py | 2 ++ intern/ghost/SConscript | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index a8bee920a9b..677ddab8db5 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -121,6 +121,7 @@ def validate_arguments(args, bc): 'BF_OPENMP_INC', 'BF_OPENMP_LIBPATH', 'WITH_GHOST_COCOA', + 'WITH_GHOST_SDL', 'USE_QTKIT', 'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE', 'BF_X264_CONFIG', @@ -385,6 +386,7 @@ def read_opts(env, cfg, args): ('BF_OPENMP_INC', 'Path to OpenMP includes (used when cross-compiling with older versions of WinGW)', ''), ('BF_OPENMP_LIBPATH', 'Path to OpenMP libraries (used when cross-compiling with older versions of WinGW)', ''), (BoolVariable('WITH_GHOST_COCOA', 'Use Cocoa-framework if true', False)), + (BoolVariable('WITH_GHOST_SDL', 'Enable building blender against SDL for windowing rather then the native APIs', False)), (BoolVariable('USE_QTKIT', 'Use QTKIT if true', False)), (BoolVariable('WITH_BF_QUICKTIME', 'Use QuickTime if true', False)), diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript index b67545f216a..ccfaa4814bc 100644 --- a/intern/ghost/SConscript +++ b/intern/ghost/SConscript @@ -14,11 +14,23 @@ if window_system == 'darwin': pf = ['GHOST_DisplayManager', 'GHOST_System', 'GHOST_SystemPaths', 'GHOST_Window', 'GHOST_DropTarget'] defs=['_USE_MATH_DEFINES'] -if window_system in ('linux2', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'irix6', 'aix4', 'aix5'): +incs = '. ../string #extern/glew/include #source/blender/imbuf #source/blender/makesdna ' + env['BF_OPENGL_INC'] + +if env['WITH_GHOST_SDL']: + for f in pf: + try: + sources.remove('intern' + os.sep + f + 'Carbon.cpp') + sources.remove('intern' + os.sep + f + 'Win32.cpp') + sources.remove('intern' + os.sep + f + 'X11.cpp') + except ValueError: + pass + incs += ' ' + env['BF_SDL_INC'] +elif window_system in ('linux2', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'irix6', 'aix4', 'aix5'): for f in pf: try: sources.remove('intern' + os.sep + f + 'Win32.cpp') sources.remove('intern' + os.sep + f + 'Carbon.cpp') + sources.remove('intern' + os.sep + f + 'SDL.cpp') except ValueError: pass defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option @@ -29,6 +41,7 @@ elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64 try: sources.remove('intern' + os.sep + f + 'X11.cpp') sources.remove('intern' + os.sep + f + 'Carbon.cpp') + sources.remove('intern' + os.sep + f + 'SDL.cpp') except ValueError: pass elif window_system == 'darwin': @@ -42,6 +55,7 @@ elif window_system == 'darwin': sources.remove('intern' + os.sep + f + 'Win32.cpp') sources.remove('intern' + os.sep + f + 'X11.cpp') sources.remove('intern' + os.sep + f + 'Carbon.cpp') + sources.remove('intern' + os.sep + f + 'SDL.cpp') except ValueError: pass else: @@ -50,6 +64,7 @@ elif window_system == 'darwin': sources.remove('intern' + os.sep + f + 'Win32.cpp') sources.remove('intern' + os.sep + f + 'X11.cpp') sources.remove('intern' + os.sep + f + 'Cocoa.mm') + sources.remove('intern' + os.sep + f + 'SDL.cpp') except ValueError: pass @@ -60,7 +75,6 @@ else: if env['BF_GHOST_DEBUG']: defs.append('BF_GHOST_DEBUG') -incs = '. ../string #extern/glew/include #source/blender/imbuf #source/blender/makesdna ' + env['BF_OPENGL_INC'] if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'): incs = env['BF_WINTAB_INC'] + ' ' + incs