disable asm in embind mode, and add a test for what embind cannot do in asm mode yet; issue #1447
This commit is contained in:
Родитель
7d395b6362
Коммит
55626711df
4
emcc
4
emcc
|
@ -1030,6 +1030,10 @@ try:
|
||||||
exec('shared.Settings.' + key + ' = ' + value)
|
exec('shared.Settings.' + key + ' = ' + value)
|
||||||
|
|
||||||
# Apply effects from settings
|
# Apply effects from settings
|
||||||
|
if bind and shared.Settings.ASM_JS:
|
||||||
|
logging.warning('disabling asm.js since embind is not ready for it yet')
|
||||||
|
shared.Settings.ASM_JS = 0
|
||||||
|
|
||||||
if shared.Settings.ASM_JS:
|
if shared.Settings.ASM_JS:
|
||||||
assert opt_level >= 1, 'asm.js requires -O1 or above'
|
assert opt_level >= 1, 'asm.js requires -O1 or above'
|
||||||
|
|
||||||
|
|
|
@ -9332,6 +9332,26 @@ def process(filename):
|
||||||
'''
|
'''
|
||||||
self.do_run(src, 'abs(-10): 10\nabs(-11): 11');
|
self.do_run(src, 'abs(-10): 10\nabs(-11): 11');
|
||||||
|
|
||||||
|
def test_embind_2(self):
|
||||||
|
if self.emcc_args is None: return self.skip('requires emcc')
|
||||||
|
Building.COMPILER_TEST_OPTS += ['--bind', '--post-js', 'post.js']
|
||||||
|
open('post.js', 'w').write('''
|
||||||
|
Module.print('lerp ' + Module.lerp(1, 2, 0.66) + '.');
|
||||||
|
''')
|
||||||
|
src = r'''
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <SDL/SDL.h>
|
||||||
|
#include <emscripten/bind.h>
|
||||||
|
using namespace emscripten;
|
||||||
|
float lerp(float a, float b, float t) {
|
||||||
|
return (1 - t) * a + t * b;
|
||||||
|
}
|
||||||
|
EMSCRIPTEN_BINDINGS(my_module) {
|
||||||
|
function("lerp", &lerp);
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
self.do_run(src, 'lerp 1.66');
|
||||||
|
|
||||||
def test_scriptaclass(self):
|
def test_scriptaclass(self):
|
||||||
if self.emcc_args is None: return self.skip('requires emcc')
|
if self.emcc_args is None: return self.skip('requires emcc')
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче