@@ -6928,9 +6928,9 @@ def test2():
69286928 do_test (test2 , level = 2 , prefix = 'hello_libcxx' )
69296929
69306930 def test_embind (self ):
6931- self . emcc_args += [ ' --bind' ]
6932-
6933- create_file ('test_embind.cpp' , r'''
6931+ # Very that both the old ` --bind` arg and the new `-lembind` arg work
6932+ for args in [[ '-lembind' ], [ '--bind' ]]:
6933+ create_file ('test_embind.cpp' , r'''
69346934 #include <stdio.h>
69356935 #include <emscripten/val.h>
69366936
@@ -6945,11 +6945,11 @@ def test_embind(self):
69456945
69466946 return 0;
69476947 }
6948- ''' )
6949- self .do_runf ('test_embind.cpp' , 'abs(-10): 10\n abs(-11): 11' )
6948+ ''' )
6949+ self .do_runf ('test_embind.cpp' , 'abs(-10): 10\n abs(-11): 11' , emcc_args = args )
69506950
69516951 def test_embind_2 (self ):
6952- self .emcc_args += ['--bind ' , '--post-js' , 'post.js' ]
6952+ self .emcc_args += ['-lembind ' , '--post-js' , 'post.js' ]
69536953 create_file ('post.js' , '''
69546954 function printLerp() {
69556955 out('lerp ' + Module.lerp(100, 200, 66) + '.');
@@ -6974,7 +6974,7 @@ def test_embind_2(self):
69746974 self .do_runf ('test_embind_2.cpp' , 'lerp 166' )
69756975
69766976 def test_embind_3 (self ):
6977- self .emcc_args += ['--bind ' , '--post-js' , 'post.js' ]
6977+ self .emcc_args += ['-lembind ' , '--post-js' , 'post.js' ]
69786978 create_file ('post.js' , '''
69796979 function ready() {
69806980 try {
@@ -7002,7 +7002,7 @@ def test_embind_3(self):
70027002 self .do_runf ('test_embind_3.cpp' , 'UnboundTypeError: Cannot call compute due to unbound types: Pi' )
70037003
70047004 def test_embind_4 (self ):
7005- self .emcc_args += ['--bind ' , '--post-js' , 'post.js' ]
7005+ self .emcc_args += ['-lembind ' , '--post-js' , 'post.js' ]
70067006 create_file ('post.js' , '''
70077007 function printFirstElement() {
70087008 out(Module.getBufferView()[0]);
@@ -7034,46 +7034,46 @@ def test_embind_4(self):
70347034 self .do_runf ('test_embind_4.cpp' , '107' )
70357035
70367036 def test_embind_5 (self ):
7037- self .emcc_args += ['--bind ' ]
7037+ self .emcc_args += ['-lembind ' ]
70387038 self .set_setting ('EXIT_RUNTIME' )
70397039 self .do_core_test ('test_embind_5.cpp' )
70407040
70417041 def test_embind_custom_marshal (self ):
7042- self .emcc_args += ['--bind ' , '--pre-js' , test_file ('embind/test_custom_marshal.js' )]
7042+ self .emcc_args += ['-lembind ' , '--pre-js' , test_file ('embind/test_custom_marshal.js' )]
70437043 self .do_run_in_out_file_test ('embind/test_custom_marshal.cpp' , assert_identical = True )
70447044
70457045 def test_embind_float_constants (self ):
7046- self .emcc_args += ['--bind ' ]
7046+ self .emcc_args += ['-lembind ' ]
70477047 self .do_run_in_out_file_test ('embind/test_float_constants.cpp' )
70487048
70497049 def test_embind_negative_constants (self ):
7050- self .emcc_args += ['--bind ' ]
7050+ self .emcc_args += ['-lembind ' ]
70517051 self .do_run_in_out_file_test ('embind/test_negative_constants.cpp' )
70527052
70537053 @also_with_wasm_bigint
70547054 def test_embind_unsigned (self ):
7055- self .emcc_args += ['--bind ' ]
7055+ self .emcc_args += ['-lembind ' ]
70567056 self .do_run_in_out_file_test ('embind/test_unsigned.cpp' )
70577057
70587058 def test_embind_val (self ):
7059- self .emcc_args += ['--bind ' ]
7059+ self .emcc_args += ['-lembind ' ]
70607060 self .do_run_in_out_file_test ('embind/test_val.cpp' )
70617061
70627062 def test_embind_val_assignment (self ):
7063- err = self .expect_fail ([EMCC , test_file ('embind/test_val_assignment.cpp' ), '--bind ' , '-c' ])
7063+ err = self .expect_fail ([EMCC , test_file ('embind/test_val_assignment.cpp' ), '-lembind ' , '-c' ])
70647064 self .assertContained ('candidate function not viable: expects an lvalue for object argument' , err )
70657065
70667066 @no_wasm2js ('wasm_bigint' )
70677067 def test_embind_i64_val (self ):
70687068 self .set_setting ('WASM_BIGINT' )
7069- self .emcc_args += ['--bind ' ]
7069+ self .emcc_args += ['-lembind ' ]
70707070 self .node_args += ['--experimental-wasm-bigint' ]
70717071 self .do_run_in_out_file_test ('embind/test_i64_val.cpp' , assert_identical = True )
70727072
70737073 @no_wasm2js ('wasm_bigint' )
70747074 def test_embind_i64_binding (self ):
70757075 self .set_setting ('WASM_BIGINT' )
7076- self .emcc_args += ['--bind ' ]
7076+ self .emcc_args += ['-lembind ' ]
70777077 self .node_args += ['--experimental-wasm-bigint' ]
70787078 self .do_run_in_out_file_test ('embind/test_i64_binding.cpp' , assert_identical = True )
70797079
@@ -7102,11 +7102,11 @@ def test_embind_no_rtti(self):
71027102 emscripten::function("dotest", &test);
71037103 }
71047104 ''' )
7105- self .emcc_args += ['--bind ' , '-fno-rtti' , '-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0' ]
7105+ self .emcc_args += ['-lembind ' , '-fno-rtti' , '-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0' ]
71067106 self .do_runf ('main.cpp' , '418\n dotest returned: 42\n ' )
71077107
71087108 def test_embind_polymorphic_class_no_rtti (self ):
7109- self .emcc_args += ['--bind ' , '-fno-rtti' , '-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0' ]
7109+ self .emcc_args += ['-lembind ' , '-fno-rtti' , '-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0' ]
71107110 self .do_core_test ('test_embind_polymorphic_class_no_rtti.cpp' )
71117111
71127112 def test_embind_no_rtti_followed_by_rtti (self ):
@@ -7134,7 +7134,7 @@ def test_embind_no_rtti_followed_by_rtti(self):
71347134 emscripten::function("dotest", &test);
71357135 }
71367136 '''
7137- self .emcc_args += ['--bind ' , '-fno-rtti' , '-frtti' ]
7137+ self .emcc_args += ['-lembind ' , '-fno-rtti' , '-frtti' ]
71387138 self .do_run (src , '418\n dotest returned: 42\n ' )
71397139
71407140 @parameterized ({
@@ -8544,7 +8544,7 @@ def test_pthread_create_embind_stack_check(self):
85448544 # embind should work with stack overflow checks (see #12356)
85458545 self .set_setting ('STACK_OVERFLOW_CHECK' , 2 )
85468546 self .set_setting ('EXIT_RUNTIME' )
8547- self .emcc_args += ['--bind ' ]
8547+ self .emcc_args += ['-lembind ' ]
85488548 self .do_run_in_out_file_test ('core/pthread/create.cpp' )
85498549
85508550 @node_pthreads
@@ -8814,7 +8814,7 @@ def test_abort_on_exceptions(self):
88148814 self .set_setting ('EXIT_RUNTIME' , 0 )
88158815 self .set_setting ('ABORT_ON_WASM_EXCEPTIONS' )
88168816 self .set_setting ('EXPORTED_RUNTIME_METHODS' , ['ccall' , 'cwrap' ])
8817- self .emcc_args += ['--bind ' , '--post-js' , test_file ('core/test_abort_on_exception_post.js' )]
8817+ self .emcc_args += ['-lembind ' , '--post-js' , test_file ('core/test_abort_on_exception_post.js' )]
88188818 self .do_core_test ('test_abort_on_exception.cpp' , interleaved_output = False )
88198819
88208820 @needs_dylink
@@ -8856,7 +8856,7 @@ def test_emscripten_async_call(self):
88568856 def test_embind_lib_with_asyncify (self , args ):
88578857 self .uses_es6 = True
88588858 self .emcc_args += [
8859- '--bind ' ,
8859+ '-lembind ' ,
88608860 '-sASYNCIFY' ,
88618861 '-sASYNCIFY_IMPORTS=["sleep_and_return"]' ,
88628862 '--post-js' , test_file ('core/embind_lib_with_asyncify.test.js' ),
0 commit comments