ref: fb5838a58b55433e51753b2a82f59eb22d792fdd
parent: d897aaed4775b429eeb8f608313a904fd54a97be
author: Paul Brossier <piem@piem.org>
date: Tue Feb 16 10:44:20 EST 2016
wscript, src/wscript_build: new build platform emscripten
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -24,6 +24,8 @@
build_features = ['cstlib', 'cshlib']
elif ctx.env['DEST_OS'] in ['win32', 'win64']:
build_features = ['cshlib']
+elif ctx.env['DEST_OS'] in ['emscripten']:
+ build_features = ['cstlib']
else: #linux, darwin, android, mingw, ...
build_features = ['cshlib', 'cstlib']
--- a/wscript
+++ b/wscript
@@ -163,6 +163,14 @@
ctx.env.CFLAGS += [ '-isysroot' , SDKROOT]
ctx.env.LINKFLAGS += [ '-isysroot' , SDKROOT]
+ if target_platform == 'emscripten':
+ import os.path
+ ctx.env.CFLAGS += [ '-I' + os.path.join(os.environ['EMSCRIPTEN'], 'system', 'include') ]
+ ctx.env.CFLAGS += ['-Oz']
+ ctx.env.cprogram_PATTERN = "%s.js"
+ if (ctx.options.enable_atlas != True):
+ ctx.options.enable_atlas = False
+
# check for required headers
ctx.check(header_name='stdlib.h')
ctx.check(header_name='stdio.h')