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',
66 'include/a/polytraj3.h',
67 'include/a/polytraj5.h',
68 'include/a/polytraj7.h',
75 'include/a/traptraj.h',
78 'include/a/version.h',
106 python = import('python').find_installation()
107 fixup_py = join_paths(meson.current_source_dir(), 'meson', 'fixup.py')
108 a_meson_h = join_paths(meson.current_build_dir(), 'a.meson.h')
109 a_h = configure_file(output: 'a.h', input: 'include/a/a.h',
110 command: [python, fixup_py, a_meson_h, '@INPUT@']
113 configure_file(input: 'include/a.meson.h.in', output: 'a.meson.h', configuration: a_have_h)
114 add_project_arguments('-DA_EXPORTS', '-DA_HAVE_H="a.meson.h"', language: ['c', 'cpp'])
115 library('a', sources,
116 dependencies: compiler.find_library('m', required: false),
117 include_directories: include_directories('include'),
118 soversion: meson.project_version().split('.')[0],
119 version: meson.project_version(),
120 link_args: get_option('math'),
123 install_headers(a_h, subdir: 'a')
124 install_headers(a_meson_h, subdir: 'a')
125 install_subdir('include/a', install_dir: get_option('includedir'))