meson.build (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
project('Circe', 'c', version: '0.1.0')
## EXTERNAL DEPENDENCIES
tct_subproj = subproject('TinyCrypT')
tct_dependency = tct_subproj.get_variable('TinyCrypT_dep')
## LIBCIRCE-COMMON
common_build_args = [
'-O3',
'-ffreestanding',
'-nostdlib',
'-lgcc',
]
common_sources = [
'common/cbor.c',
'common/memory.c',
]
common_incdir = include_directories('common/')
common_target = static_library(
'circe-common',
common_sources,
c_args: common_build_args,
include_directories: common_incdir,
)
common_dep = declare_dependency(include_directories: common_incdir, link_with: common_target)
set_variable(meson.project_name() + '_common_dep', common_dep)
# Post-quantum primitives from contrib/ (ML-KEM-768, ML-DSA-44).
# Built freestanding; they route memcpy/memset/zeroize through common's
# circe_memcpy/circe_memset, so they depend on common_dep.
# Exposes <project>_mlkem_dep and <project>_mldsa_dep.
subdir('contrib')
mlkem_dependency = get_variable(meson.project_name() + '_mlkem_dep')
mldsa_dependency = get_variable(meson.project_name() + '_mldsa_dep')
## LIBCIRCE-CORE
core_build_args = [
'-O3',
'-ffreestanding',
'-nostdlib',
'-lgcc',
]
core_sources = [
'core/core.c',
]
core_incdir = include_directories('core/')
core_target = static_library(
'circe-core',
core_sources,
c_args: core_build_args,
include_directories: core_incdir,
dependencies: [common_dep, tct_dependency, mlkem_dependency, mldsa_dependency],
)
core_dep = declare_dependency(include_directories: core_incdir, link_with: core_target)
set_variable(meson.project_name() + '_core_dep', core_dep)
if not meson.is_subproject() and not meson.is_cross_build()
# Tests go here
endif
|