2004-05-16 13:07:20 +00:00
|
|
|
#!/usr/bin/python
|
2006-02-04 14:15:10 +00:00
|
|
|
import sys
|
|
|
|
import os
|
2004-02-29 21:40:48 +00:00
|
|
|
|
2006-02-04 14:15:10 +00:00
|
|
|
Import ('env')
|
2004-01-04 21:11:59 +00:00
|
|
|
|
2006-02-05 17:14:52 +00:00
|
|
|
window_system = env['OURPLATFORM']
|
2004-01-04 21:11:59 +00:00
|
|
|
|
2009-10-27 14:11:28 +00:00
|
|
|
sources = env.Glob('intern/*.cpp')
|
|
|
|
if window_system == 'darwin':
|
2010-08-29 20:52:05 +00:00
|
|
|
sources += env.Glob('intern/*.mm')
|
2009-10-27 13:40:41 +00:00
|
|
|
|
2006-02-04 14:15:10 +00:00
|
|
|
|
2011-06-08 21:18:03 +00:00
|
|
|
pf = ['GHOST_DisplayManager', 'GHOST_System', 'GHOST_SystemPaths', 'GHOST_Window', 'GHOST_DropTarget', 'GHOST_NDOFManager']
|
2009-12-03 12:16:00 +00:00
|
|
|
defs=['_USE_MATH_DEFINES']
|
2004-01-04 21:11:59 +00:00
|
|
|
|
2011-07-12 18:39:46 +00:00
|
|
|
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']
|
2011-07-13 06:04:54 +00:00
|
|
|
defs += ['WITH_GHOST_SDL']
|
2011-09-21 08:40:30 +00:00
|
|
|
elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'aix4', 'aix5'):
|
2010-08-29 20:52:05 +00:00
|
|
|
for f in pf:
|
|
|
|
try:
|
|
|
|
sources.remove('intern' + os.sep + f + 'Win32.cpp')
|
|
|
|
sources.remove('intern' + os.sep + f + 'Carbon.cpp')
|
2011-07-12 18:39:46 +00:00
|
|
|
sources.remove('intern' + os.sep + f + 'SDL.cpp')
|
2010-08-29 20:52:05 +00:00
|
|
|
except ValueError:
|
|
|
|
pass
|
2011-10-06 02:29:15 +00:00
|
|
|
## removing because scons does not support system installation
|
|
|
|
## if this is used for blender.org builds it means our distrobution
|
|
|
|
## will find any locally installed blender and double up its script path.
|
|
|
|
## So until this is supported properly as with CMake,
|
|
|
|
## just dont use the PREFIX.
|
|
|
|
# defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option
|
2011-03-25 04:56:48 +00:00
|
|
|
defs += ['WITH_X11_XINPUT'] # XXX, make an option
|
2010-11-01 22:26:56 +00:00
|
|
|
|
2012-02-17 20:51:39 +00:00
|
|
|
# freebsd doesn't seem to support XDND protocol
|
|
|
|
if env['WITH_GHOST_XDND'] and window_system not in ('freebsd7', 'freebsd8', 'freebsd9'):
|
|
|
|
incs += ' #/extern/xdnd'
|
|
|
|
defs += ['WITH_XDND']
|
|
|
|
else:
|
|
|
|
sources.remove('intern' + os.sep + 'GHOST_DropTargetX11.cpp')
|
2012-02-17 16:58:09 +00:00
|
|
|
|
2012-04-24 12:57:58 +00:00
|
|
|
elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
2010-08-29 20:52:05 +00:00
|
|
|
for f in pf:
|
|
|
|
try:
|
|
|
|
sources.remove('intern' + os.sep + f + 'X11.cpp')
|
|
|
|
sources.remove('intern' + os.sep + f + 'Carbon.cpp')
|
2011-07-12 18:39:46 +00:00
|
|
|
sources.remove('intern' + os.sep + f + 'SDL.cpp')
|
2010-08-29 20:52:05 +00:00
|
|
|
except ValueError:
|
|
|
|
pass
|
2006-02-04 14:15:10 +00:00
|
|
|
elif window_system == 'darwin':
|
2010-08-29 20:52:05 +00:00
|
|
|
if env['WITH_GHOST_COCOA']:
|
|
|
|
if env['WITH_BF_QUICKTIME']:
|
|
|
|
defs.append('WITH_QUICKTIME')
|
|
|
|
if env['USE_QTKIT']:
|
|
|
|
defs.append('USE_QTKIT')
|
|
|
|
for f in pf:
|
|
|
|
try:
|
|
|
|
sources.remove('intern' + os.sep + f + 'Win32.cpp')
|
|
|
|
sources.remove('intern' + os.sep + f + 'X11.cpp')
|
|
|
|
sources.remove('intern' + os.sep + f + 'Carbon.cpp')
|
2011-07-12 18:39:46 +00:00
|
|
|
sources.remove('intern' + os.sep + f + 'SDL.cpp')
|
2010-08-29 20:52:05 +00:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
for f in pf:
|
|
|
|
try:
|
|
|
|
sources.remove('intern' + os.sep + f + 'Win32.cpp')
|
|
|
|
sources.remove('intern' + os.sep + f + 'X11.cpp')
|
|
|
|
sources.remove('intern' + os.sep + f + 'Cocoa.mm')
|
2011-07-12 18:39:46 +00:00
|
|
|
sources.remove('intern' + os.sep + f + 'SDL.cpp')
|
2010-08-29 20:52:05 +00:00
|
|
|
except ValueError:
|
|
|
|
pass
|
2009-10-27 13:40:41 +00:00
|
|
|
|
2006-02-04 14:15:10 +00:00
|
|
|
else:
|
2010-08-29 20:52:05 +00:00
|
|
|
print "Unknown window system specified."
|
|
|
|
Exit()
|
2004-01-04 21:11:59 +00:00
|
|
|
|
2009-12-02 00:57:12 +00:00
|
|
|
if env['BF_GHOST_DEBUG']:
|
2011-07-13 06:04:54 +00:00
|
|
|
defs.append('WITH_GHOST_DEBUG')
|
|
|
|
else:
|
2011-08-02 09:07:24 +00:00
|
|
|
sources.remove('intern' + os.sep + 'GHOST_EventPrinter.cpp')
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2011-08-02 05:52:27 +00:00
|
|
|
if env['WITH_BF_3DMOUSE']:
|
2011-08-02 09:07:24 +00:00
|
|
|
defs.append('WITH_INPUT_NDOF')
|
2011-08-02 17:59:43 +00:00
|
|
|
|
2011-08-21 13:31:46 +00:00
|
|
|
if env['OURPLATFORM']=='linux':
|
2011-08-02 17:59:43 +00:00
|
|
|
incs += ' ' + env['BF_3DMOUSE_INC']
|
2011-08-02 10:50:22 +00:00
|
|
|
else:
|
|
|
|
sources.remove('intern' + os.sep + 'GHOST_NDOFManager.cpp')
|
|
|
|
try:
|
2012-04-24 12:57:58 +00:00
|
|
|
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
2011-08-02 10:50:22 +00:00
|
|
|
sources.remove('intern' + os.sep + 'GHOST_NDOFManagerWin32.cpp')
|
|
|
|
elif window_system=='darwin':
|
|
|
|
sources.remove('intern' + os.sep + 'GHOST_NDOFManagerCocoa.mm')
|
|
|
|
else:
|
2011-08-02 14:45:35 +00:00
|
|
|
sources.remove('intern' + os.sep + 'GHOST_NDOFManagerX11.cpp')
|
2011-08-02 10:50:22 +00:00
|
|
|
except ValueError:
|
|
|
|
pass
|
2011-08-02 09:07:24 +00:00
|
|
|
|
2011-08-02 05:52:27 +00:00
|
|
|
|
2012-04-24 12:57:58 +00:00
|
|
|
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
2010-08-29 20:52:05 +00:00
|
|
|
incs = env['BF_WINTAB_INC'] + ' ' + incs
|
2012-03-20 02:17:37 +00:00
|
|
|
incs += ' ../utfconv'
|
2010-10-21 18:13:43 +00:00
|
|
|
|
|
|
|
if window_system in ('win32-vc', 'win64-vc'):
|
2011-09-27 13:18:34 +00:00
|
|
|
env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15]) #, cc_compileflags=env['CCFLAGS'].append('/WX') )
|
|
|
|
|
2011-10-27 15:50:51 +00:00
|
|
|
elif env['WITH_GHOST_COCOA']: # always use default-Apple-gcc for objC language, for gnu-compilers do not support it fully yet
|
2011-10-27 15:46:26 +00:00
|
|
|
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++' )
|
2011-09-27 13:18:34 +00:00
|
|
|
print "GHOST COCOA WILL BE COMPILED WITH APPLE GCC"
|
|
|
|
|
2010-10-21 07:14:31 +00:00
|
|
|
else:
|
2011-09-27 13:18:34 +00:00
|
|
|
env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15] )
|