r24111 broke the build on non-osx systems.
[blender.git] / intern / ghost / SConscript
1 #!/usr/bin/python
2 import sys
3 import os
4
5 Import ('env')
6
7 window_system = env['OURPLATFORM']
8
9 sources = env.Glob('intern/*.cpp')
10 if window_system == 'darwin':
11         sources += env.Glob('intern/*.mm')
12
13 if env['WITH_GHOST_COCOA'] == True:
14                 env.Append(CFLAGS=['-DGHOST_COCOA']) 
15                 env.Append(CXXFLAGS=['-DGHOST_COCOA'])
16                 env.Append(CPPFLAGS=['-DGHOST_COCOA'])
17
18 #defs = ''
19 #if env['WITH_GHOST_COCOA']:
20 #       defs += 'GHOST_COCOA'
21 # maybe we need it later
22
23 pf = ['GHOST_DisplayManager', 'GHOST_System', 'GHOST_Window']
24
25 if window_system in ('linux2', 'openbsd3', 'sunos5', 'freebsd6', 'irix6'):
26         for f in pf:
27                 sources.remove('intern' + os.sep + f + 'Win32.cpp')
28                 sources.remove('intern' + os.sep + f + 'Carbon.cpp')
29 elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
30         for f in pf:
31                 sources.remove('intern' + os.sep + f + 'X11.cpp')
32                 sources.remove('intern' + os.sep + f + 'Carbon.cpp')
33 elif window_system == 'darwin':
34         if env['WITH_GHOST_COCOA']:
35         for f in pf:
36                 sources.remove('intern' + os.sep + f + 'Win32.cpp')
37                 sources.remove('intern' + os.sep + f + 'X11.cpp')
38                         sources.remove('intern' + os.sep + f + 'Carbon.cpp')
39         else:
40                 for f in pf:
41                         sources.remove('intern' + os.sep + f + 'Win32.cpp')
42                         sources.remove('intern' + os.sep + f + 'X11.cpp')
43                         sources.remove('intern' + os.sep + f + 'Cocoa.mm')
44
45 else:
46         print "Unknown window system specified."
47         Exit()
48
49 incs = '. ../string ' + env['BF_OPENGL_INC']
50 if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
51         incs = env['BF_WINTAB_INC'] + ' ' + incs
52 env.BlenderLib ('bf_ghost', sources, Split(incs), defines=['_USE_MATH_DEFINES'], libtype=['intern','player'], priority = [40,15] ) 
53