Reordering things a bit
I currently have meson 0.52.1 and the default_library=static option has no effect for me, but I'm leaving it there in case this changes in the future.
This commit is contained in:
parent
a3dcb583d7
commit
640cc0e493
2 changed files with 13 additions and 4 deletions
15
meson.build
15
meson.build
|
@ -1,10 +1,19 @@
|
||||||
project('wrentest', 'cpp',
|
project('wrenpp', 'cpp',
|
||||||
version: '1.0.0',
|
version: '0.1.0',
|
||||||
meson_version: '>=0.49.2',
|
meson_version: '>=0.49.2',
|
||||||
default_options: ['debug=true', 'cpp_std=c++17', 'b_ndebug=if-release'],
|
default_options: ['debug=true', 'cpp_std=c++17', 'b_ndebug=if-release'],
|
||||||
)
|
)
|
||||||
|
|
||||||
wren_dep = dependency('wren', version: '>=0.2.0', fallback: ['wren', 'wren_dep'])
|
wren_dep = dependency('wren', version: '>=0.2.0',
|
||||||
|
fallback: ['wren', 'wren_dep'],
|
||||||
|
default_options: [
|
||||||
|
'default_library=static',
|
||||||
|
'build_testing=false',
|
||||||
|
'wren_with_cli=false',
|
||||||
|
'wren_installable=false',
|
||||||
|
],
|
||||||
|
static: true,
|
||||||
|
)
|
||||||
public_incl = include_directories('include')
|
public_incl = include_directories('include')
|
||||||
|
|
||||||
os = host_machine.system()
|
os = host_machine.system()
|
||||||
|
|
|
@ -49,12 +49,12 @@ int main() {
|
||||||
wren::DefConfiguration config;
|
wren::DefConfiguration config;
|
||||||
wren::VM vm(&config);
|
wren::VM vm(&config);
|
||||||
vm.interpret("my_module", g_script);
|
vm.interpret("my_module", g_script);
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
|
||||||
|
|
||||||
auto vars = variables<std::string, int>(vm, MN{"my_module", "name"}, MN{"my_module","number"});
|
auto vars = variables<std::string, int>(vm, MN{"my_module", "name"}, MN{"my_module","number"});
|
||||||
std::cout << "name = \"" << std::get<0>(vars) << "\", number = " << std::get<1>(vars) << '\n';
|
std::cout << "name = \"" << std::get<0>(vars) << "\", number = " << std::get<1>(vars) << '\n';
|
||||||
const int sum = wren::call<int>(vm, {"my_module", "Math"}, "sum_params", MN{"my_module", "number"}, 90);
|
const int sum = wren::call<int>(vm, {"my_module", "Math"}, "sum_params", MN{"my_module", "number"}, 90);
|
||||||
std::cout << "wren method returned " << sum << " (expected " << std::get<1>(vars) + 90 << ")\n";
|
std::cout << "wren method returned " << sum << " (expected " << std::get<1>(vars) + 90 << ")\n";
|
||||||
|
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue