• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import filecmp
2import os
3import subprocess
4from sys import executable as python_cmd
5
6Import('*')
7
8if env['platform'] == 'windows':
9    SConscript('getopt/SConscript')
10
11SConscript('util/xmlpool/SConscript')
12SConscript('util/SConscript')
13SConscript('compiler/SConscript')
14
15if env['hostonly']:
16    # We are just compiling the things necessary on the host for cross
17    # compilation
18    Return()
19
20
21def write_git_sha1_h_file(filename):
22    """Mesa looks for a git_sha1.h file at compile time in order to display
23    the current git hash id in the GL_VERSION string.  This function tries
24    to retrieve the git hashid and write the header file.  An empty file
25    will be created if anything goes wrong."""
26
27    args = [ python_cmd, Dir('#').abspath + '/bin/git_sha1_gen.py', '--output', filename ]
28    try:
29        subprocess.call(args)
30    except:
31        print("Warning: exception in write_git_sha1_h_file()")
32        return
33
34
35# Create the git_sha1.h header file
36write_git_sha1_h_file("git_sha1.h")
37# and update CPPPATH so the git_sha1.h header can be found
38env.Append(CPPPATH = ["#" + env['build_dir']])
39
40
41
42if env['platform'] != 'windows':
43    SConscript('loader/SConscript')
44
45# When env['gles'] is set, the targets defined in mapi/glapi/SConscript are not
46# used.  libgl-xlib and libgl-gdi adapt themselves to use the targets defined
47# in mapi/glapi-shared/SConscript.  mesa/SConscript also adapts itself to
48# enable OpenGL ES support.
49SConscript('mapi/glapi/gen/SConscript')
50SConscript('mapi/glapi/SConscript')
51
52# Haiku C++ libGL dispatch (renderers depend on libgl)
53if env['platform'] in ['haiku']:
54    SConscript('hgl/SConscript')
55
56SConscript('mesa/SConscript')
57
58if not env['embedded']:
59    if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'windows'):
60        SConscript('glx/SConscript')
61    if env['platform'] == 'haiku':
62        SConscript('egl/SConscript')
63
64    if env['gles']:
65        SConscript('mapi/shared-glapi/SConscript')
66
67SConscript('gallium/SConscript')
68
69