1 project('liba', 'c', 'cpp',
6 'default_library=both',
7 'buildtype=debugoptimized',
12 a_have_h = configuration_data()
13 a_have_h.set('version', meson.version())
14 a_have_h.set('A_VERSION', meson.project_version())
15 a_have_h.set('A_VERSION_MAJOR', meson.project_version().split('.')[0])
16 a_have_h.set('A_VERSION_MINOR', meson.project_version().split('.')[1])
17 a_have_h.set('A_VERSION_PATCH', meson.project_version().split('.')[2])
18 a_have_h.set('A_SIZE_FLOAT', get_option('float'))
19 if target_machine.endian() == 'little'
20 a_have_h.set('A_BYTE_ORDER', 1234)
21 elif target_machine.endian() == 'big'
22 a_have_h.set('A_BYTE_ORDER', 4321)
25 compiler = meson.get_compiler('c')
26 a_have_h.set('A_SIZE_POINTER', compiler.sizeof('void *'))
28 math = ['expm1', 'log1p', 'hypot', 'atan2',
29 'csqrt', 'cpow', 'cexp', 'clog',
30 'csin', 'ccos', 'ctan',
31 'csinh', 'ccosh', 'ctanh',
32 'casin', 'cacos', 'catan',
33 'casinh', 'cacosh', 'catanh']
36 float = get_option('float').to_int()
37 have = 'A_HAVE_@0@'.format(func.to_upper())
43 if compiler.has_function(func)
44 a_have_h.set(have, '1')
52 'include/a/complex.h',
60 'include/a/notefreqs.h',
61 'include/a/operator.h',
63 'include/a/pid_fuzzy.h',
64 'include/a/pid_neuro.h',
72 'include/a/trajbell.h',
73 'include/a/trajpoly3.h',
74 'include/a/trajpoly5.h',
75 'include/a/trajpoly7.h',
76 'include/a/trajtrap.h',
79 'include/a/version.h',
108 python = import('python').find_installation()
109 fixup_py = join_paths(meson.current_source_dir(), 'meson', 'fixup.py')
110 a_meson_h = join_paths(meson.current_build_dir(), 'a.meson.h')
111 a_h = configure_file(output: 'a.h', input: 'include/a/a.h',
112 command: [python, fixup_py, a_meson_h, '@INPUT@']
115 configure_file(input: 'include/a.meson.h.in', output: 'a.meson.h', configuration: a_have_h)
116 add_project_arguments('-DA_EXPORTS', '-DA_HAVE_H="a.meson.h"', language: ['c', 'cpp'])
117 library('a', sources,
118 dependencies: compiler.find_library('m', required: false),
119 include_directories: include_directories('include'),
120 soversion: meson.project_version().split('.')[0],
121 version: meson.project_version(),
122 link_args: get_option('math'),
125 install_headers(a_h, subdir: 'a')
126 install_headers(a_meson_h, subdir: 'a')
127 install_subdir('include/a', install_dir: get_option('includedir'))