From 067c8a0a5b47f47e6eaf1e035b5bdff956eb7346 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 11 Dec 2024 19:47:38 +0100 Subject: [PATCH] chore(core): cleanup `meson.build` --- core/meson.build | 2 +- core/src/meson.build | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/meson.build b/core/meson.build index 8c6cbfdc61..6f0ad87db5 100644 --- a/core/meson.build +++ b/core/meson.build @@ -37,7 +37,7 @@ endif # shared with a number of subdirs if cpp_compiler.get_id() == 'emscripten' - wasm_exported_runtime_methods = '-sEXPORTED_RUNTIME_METHODS=[\'UTF8ToString\',\'stringToNewUTF8\']' + wasm_exported_runtime_methods = '-sEXPORTED_RUNTIME_METHODS=[\'UTF8ToString\',\'stringToNewUTF8\',\'wasmExports\']' endif subdir('docs/internal') diff --git a/core/src/meson.build b/core/src/meson.build index d80aae84bd..a9771e4747 100644 --- a/core/src/meson.build +++ b/core/src/meson.build @@ -138,11 +138,14 @@ mock_files = files( 'mock/mock_processor.cpp', ) +extra_defns = [] +extra_links = [] if cpp_compiler.get_id() == 'emscripten' - links += [ - '-sEXPORTED_RUNTIME_METHODS=[\'UTF8ToString\',\'stringToNewUTF8\',\'wasmExports\']', + extra_defns += ['-g'] + extra_links += ['-sSAFE_HEAP=1', wasm_exported_runtime_methods, # Forcing inclusion of debug symbols '-g', '-Wlimited-postlink-optimizations', + '--emit-tsd', 'keymancore.d.ts', '-lembind' ] host_links = [ @@ -163,8 +166,8 @@ lib = library('keymancore', mock_files, version_res, generated_headers, - cpp_args: defns + warns + flags, - link_args: links, + cpp_args: defns + extra_defns + warns + flags, + link_args: links + extra_links, version: lib_version, include_directories: inc, pic: true, @@ -187,9 +190,9 @@ pkg.generate( if cpp_compiler.get_id() == 'emscripten' # Build an executable host = executable('km-core', - cpp_args: defns, + cpp_args: defns + extra_defns, include_directories: inc, - link_args: links + host_links, + link_args: links + host_links + extra_links, objects: lib.extract_all_objects(recursive: false)) if get_option('buildtype') == 'release'