-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmeson.build
72 lines (55 loc) · 1.79 KB
/
meson.build
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
62
63
64
65
66
67
68
69
70
71
project('stereodemux', 'cpp', default_options : ['warning_level=3', 'buildtype=release', 'optimization=3'],
version: '1.0')
# Store version number to be compiled in
conf = configuration_data()
conf.set_quoted('VERSION', meson.project_version())
configure_file(output : 'config.h',
configuration : conf)
########################
### Compiler options ###
########################
cc = meson.get_compiler('cpp')
add_project_arguments(cc.get_supported_arguments([
'-Wno-unknown-pragmas']), language: 'cpp')
# We want to use M_PI on Windows
if build_machine.system() == 'windows'
add_project_arguments('-D_USE_MATH_DEFINES=1', language : 'cpp')
endif
# Explicit GNU extensions on Cygwin
if build_machine.system() == 'cygwin'
add_project_arguments('-std=gnu++11', language : 'cpp')
else
add_project_arguments('-std=c++11', language : 'cpp')
endif
####################
### Dependencies ###
####################
# Find liquid-dsp
if build_machine.system() == 'darwin'
fs = import('fs')
# Homebrew system
if fs.is_dir('/opt/homebrew/lib')
liquid_lib = cc.find_library('liquid',
dirs : ['/opt/homebrew/lib'])
liquid_inc = include_directories('/opt/homebrew/include')
# MacPorts system
else
liquid_lib = cc.find_library('liquid',
dirs : ['/opt/local/lib'])
liquid_inc = include_directories('/opt/local/include')
endif
liquid = declare_dependency(dependencies : liquid_lib,
include_directories : liquid_inc)
else
liquid = cc.find_library('liquid')
endif
############################
### Sources & Executable ###
############################
sources = [
'src/demux.cc',
'src/liquid_wrappers.cc',
'src/options.cc'
]
executable('demux', sources, dependencies: [liquid],
install: true)