quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

commit 707b2357086413ea12954dfb11512d0281997cb2
parent cd15672d14a45954f0044633f42d538cf2dca679
Author: Florian Dold <florian@dold.me>
Date:   Mon,  9 Jan 2023 10:13:30 +0100

Comment meson targets

Diffstat:
Mmeson.build | 25+++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/meson.build b/meson.build @@ -24,30 +24,41 @@ cc = meson.get_compiler('c') m_dep = cc.find_library('m', required : false) +# TLS library mbedtls_proj = subproject('mbedtls', required : true) #mbedcrypto_dep = cc.find_library('mbedcrypto', required : true) mbedcrypto_dep = mbedtls_proj.get_variable('mbedcrypto_dep') mbedtls_dep = mbedtls_proj.get_variable('mbedtls_dep') mbedx509_dep = mbedtls_proj.get_variable('mbedx509_dep') +# Library for HTTP requests curl_proj = subproject('curl', required : true) # curl_dep = cc.find_library('curl', required : true) curl_dep = curl_proj.get_variable('curl_dep') +# Crypto library sodium_proj = subproject('libsodium', required : true) #sodium_dep = cc.find_library('sodium', required : true) sodium_dep = sodium_proj.get_variable('sodium_dep') +# quickjs math library (big float) libbf = static_library('bf', 'quickjs/libbf.c') +# regular expression library libregexp = static_library('regexp', 'quickjs/libregexp.c') +# unicode libunicode = static_library('unicode', 'quickjs/libunicode.c') +# general utilities cutils = static_library('cutils', 'quickjs/cutils.c') +# standard library for quickjs (std and os modules) quickjs_libc = static_library('quickjs-libc', 'quickjs/quickjs-libc.c', dependencies : curl_dep ) +# base JS interpreter quickjs = static_library('quickjs', 'quickjs/quickjs.c') # avoid warning but compile more slowly on non-cross builds avoid_cross_warning = true +# native version of quickjs used by the qjsc (.js -> .c compiler), +# compiled for the build platform. if avoid_cross_warning or meson.is_cross_build() libbf_native = static_library('bf_native', 'quickjs/libbf.c', native : true) libregexp_native = static_library('regexp_native', 'quickjs/libregexp.c', native : true) @@ -63,6 +74,7 @@ else quickjs_native = quickjs endif +# QuickJS compiler (.js -> C) qjsc_exe = executable('qjsc', [ 'quickjs/qjsc.c', 'quickjs/quickjs-libc.c', @@ -81,6 +93,8 @@ qjsc_exe = executable('qjsc', [ ], native : true) +# JS implementation of the read-eval-print loop, +# just used for interactive testing repl_c = custom_target('repl_c', input : ['quickjs/repl.js'], output : ['repl.c'], @@ -88,6 +102,8 @@ repl_c = custom_target('repl_c', '-o', '@OUTPUT@', '@INPUT@']) +# Helper functions used by the wallet-core JS, +# compiled to C. prelude_c = custom_target('prelude_c', input : ['prelude.js'], output : ['prelude.c'], @@ -95,6 +111,8 @@ prelude_c = custom_target('prelude_c', '-o', '@OUTPUT@', '@INPUT@']) +# Wallet core JS file, +# compiled to C. wallet_core_c = custom_target('wallet_core_c', input : ['taler-wallet-core-qjs.mjs'], output : ['wallet_core.c'], @@ -102,10 +120,12 @@ wallet_core_c = custom_target('wallet_core_c', '-o', '@OUTPUT@', '@INPUT@']) +# Static libraries from the generated C files repl = static_library('repl', repl_c) prelude = static_library('prelude', prelude_c) wallet_core = static_library('wallet_core', wallet_core_c) +# Taler runtime ("tart") loadable JavaScript module tart = static_library('tart', 'tart_module.c', dependencies : [ m_dep, mbedcrypto_dep, @@ -115,6 +135,8 @@ tart = static_library('tart', 'tart_module.c', dependencies : [ sodium_dep ]) +# Interactive JS interpreter with Taler-specific +# functions (crypto etc.) qtart_exe = executable('qtart', [ 'qtart.c', ], @@ -139,6 +161,8 @@ qtart_exe = executable('qtart', [ sodium_dep ]) +# Shared library that implements wallet-core, typically +# the only build output directly used by the UI layer. talerwalletcore_lib = shared_library('talerwalletcore', 'taler_wallet_core_lib.c', link_with : [ libbf, @@ -160,6 +184,7 @@ talerwalletcore_lib = shared_library('talerwalletcore', 'taler_wallet_core_lib.c sodium_dep ]) +# Example for using libtalerwalletcore.so wallet_client_example_exe = executable('wallet-client-example', 'wallet-client-example.c', link_with : [talerwalletcore_lib])