Brian Paul | ace3124 | 2016-06-15 10:42:34 -0600 | [diff] [blame] | 1 | import filecmp |
| 2 | import os |
| 3 | import subprocess |
Jose Fonseca | b99dcbf | 2017-08-01 14:36:16 +0100 | [diff] [blame] | 4 | from sys import executable as python_cmd |
José Fonseca | 33ceb67 | 2008-02-18 10:52:44 +0000 | [diff] [blame] | 5 | |
Brian Paul | ace3124 | 2016-06-15 10:42:34 -0600 | [diff] [blame] | 6 | Import('*') |
José Fonseca | 982609f | 2011-02-11 17:38:54 +0000 | [diff] [blame] | 7 | |
José Fonseca | 601498a | 2010-11-01 13:30:22 +0000 | [diff] [blame] | 8 | if env['platform'] == 'windows': |
José Fonseca | 6d670f6 | 2011-01-12 15:32:17 +0000 | [diff] [blame] | 9 | SConscript('getopt/SConscript') |
Chia-I Wu | 1e6c10f | 2010-05-31 11:47:58 +0800 | [diff] [blame] | 10 | |
Kenneth Graunke | 1e0da62 | 2014-02-24 23:39:14 -0800 | [diff] [blame] | 11 | SConscript('util/SConscript') |
Emil Velikov | 1a882fd | 2016-01-18 10:47:13 +0200 | [diff] [blame] | 12 | SConscript('compiler/SConscript') |
José Fonseca | 982609f | 2011-02-11 17:38:54 +0000 | [diff] [blame] | 13 | |
| 14 | if env['hostonly']: |
| 15 | # We are just compiling the things necessary on the host for cross |
| 16 | # compilation |
| 17 | Return() |
| 18 | |
Brian Paul | ace3124 | 2016-06-15 10:42:34 -0600 | [diff] [blame] | 19 | |
| 20 | def write_git_sha1_h_file(filename): |
| 21 | """Mesa looks for a git_sha1.h file at compile time in order to display |
| 22 | the current git hash id in the GL_VERSION string. This function tries |
| 23 | to retrieve the git hashid and write the header file. An empty file |
| 24 | will be created if anything goes wrong.""" |
| 25 | |
Eric Engestrom | 7088622 | 2017-10-25 14:04:35 +0100 | [diff] [blame] | 26 | args = [ python_cmd, Dir('#').abspath + '/bin/git_sha1_gen.py', '--output', filename ] |
| 27 | try: |
| 28 | subprocess.call(args) |
| 29 | except: |
| 30 | print("Warning: exception in write_git_sha1_h_file()") |
| 31 | return |
Brian Paul | ace3124 | 2016-06-15 10:42:34 -0600 | [diff] [blame] | 32 | |
| 33 | |
| 34 | # Create the git_sha1.h header file |
| 35 | write_git_sha1_h_file("git_sha1.h") |
| 36 | # and update CPPPATH so the git_sha1.h header can be found |
| 37 | env.Append(CPPPATH = ["#" + env['build_dir']]) |
| 38 | |
| 39 | |
| 40 | |
Jose Fonseca | 47870d6 | 2015-03-24 20:26:21 +0000 | [diff] [blame] | 41 | if env['platform'] != 'windows': |
| 42 | SConscript('loader/SConscript') |
José Fonseca | 982609f | 2011-02-11 17:38:54 +0000 | [diff] [blame] | 43 | |
Brian Paul | dff36e9 | 2012-05-30 10:08:11 -0600 | [diff] [blame] | 44 | SConscript('mapi/glapi/gen/SConscript') |
José Fonseca | 601498a | 2010-11-01 13:30:22 +0000 | [diff] [blame] | 45 | SConscript('mapi/glapi/SConscript') |
Alexander von Gluck IV | 61ef697 | 2013-12-31 15:39:49 -0600 | [diff] [blame] | 46 | |
José Fonseca | 601498a | 2010-11-01 13:30:22 +0000 | [diff] [blame] | 47 | SConscript('mesa/SConscript') |
José Fonseca | 1ca2945 | 2010-08-13 13:53:04 +0100 | [diff] [blame] | 48 | |
José Fonseca | 706eda3 | 2010-03-09 15:07:57 +0000 | [diff] [blame] | 49 | SConscript('gallium/SConscript') |
José Fonseca | 57d0001 | 2009-01-23 12:32:35 +0000 | [diff] [blame] | 50 | |