mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
handle meson optoins properly
This commit is contained in:
parent
44c096d25c
commit
93c0ec8811
2 changed files with 37 additions and 39 deletions
73
meson.build
73
meson.build
|
@ -3,54 +3,49 @@ project('Miraclecast',
|
||||||
version: '1',
|
version: '1',
|
||||||
meson_version: '>=0.39',
|
meson_version: '>=0.39',
|
||||||
default_options: ['buildtype=debugoptimized',
|
default_options: ['buildtype=debugoptimized',
|
||||||
'c_std=gnu11',
|
'c_std=gnu11',
|
||||||
'b_lundef=true',
|
'b_lundef=true',
|
||||||
'b_sanitize=address']
|
'b_sanitize=address']
|
||||||
)
|
)
|
||||||
|
|
||||||
glib2 = dependency('glib-2.0')
|
|
||||||
udev = dependency('libudev')
|
|
||||||
libsystemd = dependency('libsystemd')
|
|
||||||
gstreamer = dependency('gstreamer-1.0')
|
|
||||||
gstreamer_base = dependency('gstreamer-base-1.0')
|
|
||||||
|
|
||||||
if get_option('build-enable-debug')
|
|
||||||
add_project_arguments('-DBUILD_ENABLE_DEBUG', language: 'c')
|
|
||||||
endif
|
|
||||||
|
|
||||||
c_compiler = meson.get_compiler('c')
|
|
||||||
if c_compiler.has_argument('-std=gnu11')
|
|
||||||
add_project_arguments('-std=gnu11', language: 'c')
|
|
||||||
endif
|
|
||||||
|
|
||||||
readline = c_compiler.find_library('readline', required: false)
|
|
||||||
if readline.found()
|
|
||||||
add_project_arguments('-DHAVE_READLINE', language: 'c')
|
|
||||||
endif
|
|
||||||
|
|
||||||
add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
||||||
|
|
||||||
r = c_compiler.compiles('''int main() { return _Generic(0, int: 0); }''',
|
|
||||||
name: 'C11 generic selection')
|
|
||||||
if false == r
|
|
||||||
error('C11 generic selection is required')
|
|
||||||
endif
|
|
||||||
|
|
||||||
subdir('src')
|
|
||||||
subdir('res')
|
|
||||||
subdir('test')
|
|
||||||
|
|
||||||
if get_option('build-demo')
|
|
||||||
subdir('demo')
|
|
||||||
endif
|
|
||||||
|
|
||||||
conf_data = configuration_data()
|
conf_data = configuration_data()
|
||||||
conf_data.set('BUILD_BINDIR',
|
conf_data.set('BUILD_BINDIR',
|
||||||
'"' + join_paths(get_option('prefix'), get_option('bindir')) + '"'
|
'"' + join_paths(get_option('prefix'), get_option('bindir')) + '"'
|
||||||
)
|
)
|
||||||
conf_data.set('PACKAGE_STRING',
|
conf_data.set('PACKAGE_STRING',
|
||||||
'"@0@ @1@"'.format(meson.project_name(),
|
'"@0@ @1@"'.format(meson.project_name(), meson.project_version())
|
||||||
meson.project_version()))
|
)
|
||||||
configure_file(output: 'config.h',
|
configure_file(output: 'config.h',
|
||||||
configuration: conf_data
|
configuration: conf_data
|
||||||
)
|
)
|
||||||
|
|
||||||
|
c_compiler = meson.get_compiler('c')
|
||||||
|
readline = c_compiler.find_library('readline', required: false)
|
||||||
|
if readline.found()
|
||||||
|
add_project_arguments('-DHAVE_READLINE', language: 'c')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('build-enable-debug')
|
||||||
|
add_project_arguments('-DBUILD_ENABLE_DEBUG', language: 'c')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('rely-udev')
|
||||||
|
add_project_arguments('-DRELY_UDEV', language: 'c')
|
||||||
|
endif
|
||||||
|
|
||||||
|
glib2 = dependency('glib-2.0')
|
||||||
|
udev = dependency('libudev')
|
||||||
|
libsystemd = dependency('libsystemd')
|
||||||
|
|
||||||
|
subdir('src')
|
||||||
|
subdir('res')
|
||||||
|
|
||||||
|
if get_option('build-tests')
|
||||||
|
subdir('test')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('build-demo')
|
||||||
|
subdir('demo')
|
||||||
|
endif
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
gstreamer = dependency('gstreamer-1.0')
|
||||||
|
gstreamer_base = dependency('gstreamer-base-1.0')
|
||||||
|
|
||||||
inc = include_directories('../..', '../ctl',)
|
inc = include_directories('../..', '../ctl',)
|
||||||
deps = [libsystemd, gstreamer, gstreamer_base, libmiracle_shared_dep]
|
deps = [libsystemd, gstreamer, gstreamer_base, libmiracle_shared_dep]
|
||||||
if readline.found()
|
if readline.found()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue