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 |
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_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)
## 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],
)
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
|