wlroots/include/meson.build
Simon Ser 6c897756b6 build: use a configuration file for internal features
This avoids re-building the whole project when switching one
Meson option. This shrinks down the compiler invocation command
line, making it more readable and making it easier to inspect
which flags are passed in (the generated file can be opened).
Additionally this is more consistent with our external feature
handling, which uses <wlr/config.h> already.
2022-12-06 22:39:45 +00:00

41 lines
1007 B
Meson

subdir('wlr')
exclude_files = ['meson.build', 'config.h.in', 'version.h.in']
if not features.get('drm-backend')
exclude_files += 'backend/drm.h'
exclude_files += 'types/wlr_drm_lease_v1.h'
endif
if not features.get('libinput-backend')
exclude_files += 'backend/libinput.h'
endif
if not features.get('x11-backend')
exclude_files += 'backend/x11.h'
endif
if not features.get('xwayland')
exclude_files += 'xwayland.h'
else
subdir('xwayland')
endif
if not features.get('gles2-renderer')
exclude_files += ['render/egl.h', 'render/gles2.h']
endif
if not features.get('vulkan-renderer')
exclude_files += 'render/vulkan.h'
endif
if not features.get('session')
exclude_files += 'backend/session.h'
endif
install_subdir('wlr',
install_dir: get_option('includedir'),
exclude_files: exclude_files,
)
foreach name, have : internal_features
internal_config.set10('HAS_' + name.underscorify().to_upper(), have)
endforeach
wlr_files += configure_file(
output: 'config.h',
configuration: internal_config,
)