build: Add meson build system

This commit is contained in:
Kiran K
2022-06-03 16:00:13 +05:30
parent 7f8363b9d9
commit 9405f98d00
5 changed files with 132 additions and 0 deletions
+12
View File
@@ -100,3 +100,15 @@ validated.
For more detail on conformance, refer to [_Bluetooth Conformance
Documents and scripts_](https://www.bluetooth.com/specifications/specs/low-complexity-communication-codec-1-0/)
## Meson build system
Meson build system is also available to build and install lc3 codec in Linux
environment.
```sh
$ meson build
$ cd build
$ ninja
$ sudo ninja install
```
+31
View File
@@ -0,0 +1,31 @@
# Copyright © 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
project('lc3', 'c',
version: '0.1',
license: 'Apache-2.0',
meson_version: '>= 0.47.0',
default_options: ['b_lto=true'])
add_project_arguments('-ffast-math', language: 'c')
cc = meson.get_compiler('c')
m_dep = cc.find_library('m', required: false)
subdir('src')
if get_option('tools')
subdir('tools')
endif
+18
View File
@@ -0,0 +1,18 @@
# Copyright © 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
option('tools',
type: 'boolean',
value: false,
description: 'Build tools')
+46
View File
@@ -0,0 +1,46 @@
# Copyright © 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
inc = include_directories('../include')
lc3_sources = [
'attdet.c',
'bits.c',
'bwdet.c',
'energy.c',
'lc3.c',
'ltpf.c',
'mdct.c',
'plc.c',
'sns.c',
'spec.c',
'tables.c',
'tns.c'
]
lc3lib = library('lc3',
lc3_sources,
dependencies: m_dep,
include_directories: inc,
install: true)
install_headers('../include/lc3.h', '../include/lc3_private.h')
pkg_mod = import('pkgconfig')
pkg_mod.generate(libraries : lc3lib,
version : '0.1',
name : 'liblc3',
filebase : 'lc3',
description : 'LC3 codec library')
+25
View File
@@ -0,0 +1,25 @@
# Copyright © 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
inc = include_directories('../include')
executable('elc3', ['elc3.c', 'lc3bin.c', 'wave.c'],
link_with : lc3lib,
include_directories: inc,
dependencies: m_dep)
executable('dlc3', ['dlc3.c', 'lc3bin.c', 'wave.c'],
link_with : lc3lib,
include_directories: inc,
dependencies: m_dep)