Skip to content

Commit

Permalink
feat: build with meson
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolitzer committed Apr 29, 2024
1 parent f02f2dc commit 1f12e6f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
39 changes: 39 additions & 0 deletions sys-utils/libcmt/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
project('libcmt', 'c', default_options: {'default_library': 'both'})
build = meson.get_compiler('c', native: true)
host = meson.get_compiler('c', native: false)

src_base = files(
'src/abi.c',
'src/buf.c',
'src/keccak.c',
'src/merkle.c',
'src/rollup.c',
'src/util.c')

inccmt = include_directories('src')
libcmt = library('cmt',
src_base + 'src/io.c',
override_options: ['b_coverage=false'],
native: false)

libmock = library('cmt-mock',
src_base + 'src/io-mock.c',
native: true)

tests = [
'abi-multi',
'abi-single',
'buf',
'io',
'gio',
'keccak',
'merkle',
'progress',
'rollup',
]

foreach name: tests
src = 'tests/' + name + '.c'
exe = executable(name, src, include_directories: inccmt, link_with: libmock, native: true)
test(name, exe)
endforeach
12 changes: 12 additions & 0 deletions sys-utils/libcmt/riscv64.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[binaries]
c = 'riscv64-linux-gnu-gcc'
cpp = 'riscv64-linux-gnu-g++'
ld = 'riscv64-linux-gnu-ld'
ar = 'riscv64-linux-gnu-ar'
strip = 'riscv64-linux-gnu-strip'

[host_machine]
system = 'linux'
cpu_family = 'riscv64'
cpu = 'rv64gc'
endian = 'little'

0 comments on commit 1f12e6f

Please sign in to comment.