Skip to content
Snippets Groups Projects
Commit ba50cefc authored by Jakob Bornecrantz's avatar Jakob Bornecrantz
Browse files

meson: Tidy meson.build a bit

parent 059234bb
Branches
No related tags found
No related merge requests found
...@@ -32,6 +32,23 @@ add_project_arguments(cpp.get_supported_arguments([ ...@@ -32,6 +32,23 @@ add_project_arguments(cpp.get_supported_arguments([
'-Wno-deprecated-copy', # Eigen '-Wno-deprecated-copy', # Eigen
]), language: 'cpp') ]), language: 'cpp')
#
# Pre-setting these variables
#
build_docs = false
build_tracking = false
v4l2_required = false
hidapi_required = false
openhmd_required = false
#
# Adding dependencies
#
glslangValidator = find_program('glslangValidator') glslangValidator = find_program('glslangValidator')
avcodec = dependency('libavcodec', required: false) avcodec = dependency('libavcodec', required: false)
...@@ -56,8 +73,6 @@ pthreads = cc.find_library('pthread', required: true) ...@@ -56,8 +73,6 @@ pthreads = cc.find_library('pthread', required: true)
if get_option('tracking').enabled() or get_option('tracking').auto() if get_option('tracking').enabled() or get_option('tracking').auto()
build_tracking = opencv.found() build_tracking = opencv.found()
else
build_tracking = false
endif endif
# TODO: make these behave well when not present # TODO: make these behave well when not present
...@@ -76,10 +91,6 @@ if wayland_scanner.found() ...@@ -76,10 +91,6 @@ if wayland_scanner.found()
) )
endif endif
hidapi_required = false
openhmd_required = false
v4l2_required = false
# For now required on Linux # For now required on Linux
if target_machine.system() == 'linux' if target_machine.system() == 'linux'
v4l2_required = true v4l2_required = true
...@@ -130,8 +141,6 @@ endif ...@@ -130,8 +141,6 @@ endif
if drivers.length() == 0 or drivers == ['auto'] if drivers.length() == 0 or drivers == ['auto']
error('You must enable at least one driver.') error('You must enable at least one driver.')
else
message('Building with drivers ' + ', '.join(drivers))
endif endif
if udev.found() if udev.found()
...@@ -162,12 +171,26 @@ if sdl2.found() ...@@ -162,12 +171,26 @@ if sdl2.found()
add_project_arguments('-DXRT_HAVE_SDL2', language: ['c', 'cpp']) add_project_arguments('-DXRT_HAVE_SDL2', language: ['c', 'cpp'])
endif endif
if doxygen.found()
build_docs = true
endif
#
# Go down sub directories
#
subdir('src') subdir('src')
if doxygen.found() if build_docs
subdir('doc') subdir('doc')
endif endif
#
# Final bits
#
# This is here so that it gets emitted in the top-level build directory # This is here so that it gets emitted in the top-level build directory
manifest_devconf = configuration_data() manifest_devconf = configuration_data()
# https://github.com/mesonbuild/meson/issues/5940 # https://github.com/mesonbuild/meson/issues/5940
...@@ -178,3 +201,18 @@ manifest_dev_json = configure_file( ...@@ -178,3 +201,18 @@ manifest_dev_json = configure_file(
output: 'openxr_monado-dev.json', output: 'openxr_monado-dev.json',
configuration: manifest_devconf, configuration: manifest_devconf,
) )
message('Configuration done!')
message(' drivers: ' + ', '.join(drivers))
if build_docs
message(' docs: yes')
else
message(' docs: no')
endif
if build_tracking
message(' tracking: yes')
else
message(' tracking: no')
endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment