3 # ***** BEGIN GPL LICENSE BLOCK *****
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
22 # The Original Code is: all of this file.
24 # Contributor(s): Nathan Letwory.
26 # ***** END GPL LICENSE BLOCK *****
33 window_system = env['OURPLATFORM']
35 sources = env.Glob('intern/*.cpp')
36 if window_system == 'darwin':
37 sources += env.Glob('intern/*.mm')
40 pf = ['GHOST_DisplayManager', 'GHOST_System', 'GHOST_SystemPaths', 'GHOST_Window', 'GHOST_DropTarget', 'GHOST_NDOFManager']
41 defs=['_USE_MATH_DEFINES']
43 incs = '. ../string #extern/glew/include #source/blender/imbuf #source/blender/makesdna ' + env['BF_OPENGL_INC']
45 if env['WITH_GHOST_SDL']:
48 sources.remove('intern' + os.sep + f + 'Carbon.cpp')
49 sources.remove('intern' + os.sep + f + 'Win32.cpp')
50 sources.remove('intern' + os.sep + f + 'X11.cpp')
53 incs += ' ' + env['BF_SDL_INC']
54 defs += ['WITH_GHOST_SDL']
55 elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'aix4', 'aix5'):
58 sources.remove('intern' + os.sep + f + 'Win32.cpp')
59 sources.remove('intern' + os.sep + f + 'Carbon.cpp')
60 sources.remove('intern' + os.sep + f + 'SDL.cpp')
63 ## removing because scons does not support system installation
64 ## if this is used for blender.org builds it means our distrobution
65 ## will find any locally installed blender and double up its script path.
66 ## So until this is supported properly as with CMake,
67 ## just dont use the PREFIX.
68 # defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option
69 defs += ['WITH_X11_XINPUT'] # XXX, make an option
71 # freebsd doesn't seem to support XDND protocol
72 if env['WITH_GHOST_XDND'] and window_system not in ('freebsd7', 'freebsd8', 'freebsd9'):
73 incs += ' #/extern/xdnd'
76 sources.remove('intern' + os.sep + 'GHOST_DropTargetX11.cpp')
78 elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc', 'win64-mingw'):
81 sources.remove('intern' + os.sep + f + 'X11.cpp')
82 sources.remove('intern' + os.sep + f + 'Carbon.cpp')
83 sources.remove('intern' + os.sep + f + 'SDL.cpp')
86 elif window_system == 'darwin':
87 if env['WITH_GHOST_COCOA']:
88 if env['WITH_BF_QUICKTIME']:
89 defs.append('WITH_QUICKTIME')
91 defs.append('USE_QTKIT')
94 sources.remove('intern' + os.sep + f + 'Win32.cpp')
95 sources.remove('intern' + os.sep + f + 'X11.cpp')
96 sources.remove('intern' + os.sep + f + 'Carbon.cpp')
97 sources.remove('intern' + os.sep + f + 'SDL.cpp')
103 sources.remove('intern' + os.sep + f + 'Win32.cpp')
104 sources.remove('intern' + os.sep + f + 'X11.cpp')
105 sources.remove('intern' + os.sep + f + 'Cocoa.mm')
106 sources.remove('intern' + os.sep + f + 'SDL.cpp')
111 print "Unknown window system specified."
114 if env['BF_GHOST_DEBUG']:
115 defs.append('WITH_GHOST_DEBUG')
117 sources.remove('intern' + os.sep + 'GHOST_EventPrinter.cpp')
119 if env['WITH_BF_3DMOUSE']:
120 defs.append('WITH_INPUT_NDOF')
122 if env['OURPLATFORM'] in ('linux','darwin'):
123 incs += ' ' + env['BF_3DMOUSE_INC']
125 sources.remove('intern' + os.sep + 'GHOST_NDOFManager.cpp')
127 if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc', 'win64-mingw'):
128 sources.remove('intern' + os.sep + 'GHOST_NDOFManagerWin32.cpp')
129 elif window_system=='darwin':
130 sources.remove('intern' + os.sep + 'GHOST_NDOFManagerCocoa.mm')
132 sources.remove('intern' + os.sep + 'GHOST_NDOFManagerX11.cpp')
137 if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc', 'win64-mingw'):
138 incs = env['BF_WINTAB_INC'] + ' ' + incs
139 incs += ' ../utfconv'
141 if window_system in ('win32-vc', 'win64-vc'):
142 env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15]) #, cc_compileflags=env['CCFLAGS'].append('/WX') )
144 elif env['WITH_GHOST_COCOA']: # always use default-Apple-gcc for objC language, for gnu-compilers do not support it fully yet
145 env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15], cc_compilerchange='/usr/bin/gcc', cxx_compilerchange='/usr/bin/g++' )
146 print "GHOST COCOA WILL BE COMPILED WITH APPLE GCC"
149 env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15] )