timdac/meson.build

38 lines
916 B
Meson
Raw Normal View History

2023-01-02 18:55:41 +00:00
project('timdac', 'c', default_options: ['default_library=static'])
o_hw = get_option('timdac_hw')
o_bsp = get_option('bsp')
o_bsp_dep = get_option('bsp_dep')
2023-01-02 18:55:41 +00:00
sources = ['src/timdac.c', 'src/timdac_ll.c']
dependencies = []
defs = []
if o_hw == 'ch32v103'
ch32v103_proj = subproject('ch32v103-meson')
ch32v103_dep = ch32v103_proj.get_variable('ch32v103_dep')
dependencies += ch32v103_dep
sources += ['src/timdac_hw_ch32v103.c']
endif
if o_bsp != ''
bsp_proj = subproject(o_bsp)
bsp_dep = bsp_proj.get_variable(o_bsp_dep)
dependencies += bsp_dep
endif
2023-01-02 18:55:41 +00:00
add_project_arguments(defs, language: ['c', 'cpp'])
2023-01-02 19:27:57 +00:00
2023-01-02 18:55:41 +00:00
timdac_lib = library(
'timdac',
sources,
dependencies: dependencies,
2023-01-02 23:13:21 +00:00
include_directories: ['inc'],
2023-01-02 18:55:41 +00:00
)
libtimdac_dep = declare_dependency(
compile_args: defs,
2023-01-02 23:13:21 +00:00
include_directories: include_directories('inc'),
2023-01-02 18:55:41 +00:00
link_with: timdac_lib,
)