all repos — TinyCrypT @ 7906aa7e16857901026e3caf74e04e0a4d5c7547

Short and sweet classical cryptographic primitives

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
project('TinyCrypT', 'c', version: '0.1.0')

incdir = include_directories('tinycrypt')

sources = [
    'tinycrypt/chacha20-poly1305.c',
    'tinycrypt/ed25519.c',
    'tinycrypt/kangarootwelve128.c',
    'tinycrypt/sha2.c',
    'tinycrypt/x25519.c',
]

build_args = [
    '-Os',
    '-ffreestanding',
]

target = static_library('tinycrypt', sources, c_args: build_args, include_directories: incdir)

project_dep = declare_dependency(
  include_directories: incdir,
  link_with : target
)
set_variable(meson.project_name() + '_dep', project_dep)

test_sources = [
    'tests/src/sha256.cpp',
]

if not meson.is_subproject()
    add_languages('cpp')
    subdir('tests')
    test(
        'all_tests',
        executable(
            'run_tests',
            test_sources,
            include_directories: incdir,
            link_with: target,
            dependencies: test_dep,
            install: false
        )
    )
endif