summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct51
1 files changed, 50 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index 8880d851e6..8607d2cd8e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -56,6 +56,12 @@ else:
Help(opts.GenerateHelpText(env))
+# fail early for a common error on windows
+if env['gles']:
+ try:
+ import libxml2
+ except ImportError:
+ raise SCons.Errors.UserError, "GLES requires libxml2-python to build"
#######################################################################
# Environment setup
@@ -115,8 +121,51 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
# for debugging
#print env.Dump()
-Export('env')
+#######################################################################
+# Invoke host SConscripts
+#
+# For things that are meant to be run on the native host build machine, instead
+# of the target machine.
+#
+
+# Create host environent
+if env['crosscompile'] and env['platform'] != 'embedded':
+ host_env = Environment(
+ options = opts,
+ # no tool used
+ tools = [],
+ toolpath = ['#scons'],
+ ENV = os.environ,
+ )
+
+ # Override options
+ host_env['platform'] = common.host_platform
+ host_env['machine'] = common.host_machine
+ host_env['toolchain'] = 'default'
+ host_env['llvm'] = False
+
+ host_env.Tool('gallium')
+
+ host_env['hostonly'] = True
+ assert host_env['crosscompile'] == False
+
+ if host_env['msvc']:
+ host_env.Append(CPPPATH = ['#include/c99'])
+
+ target_env = env
+ env = host_env
+ Export('env')
+
+ SConscript(
+ 'src/SConscript',
+ variant_dir = host_env['build_dir'],
+ duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
+ )
+
+ env = target_env
+
+Export('env')
#######################################################################
# Invoke SConscripts