Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson.build spring cleaning #49

Merged
merged 3 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ project(

# When doing a major or minor release, *always* increase soversion. This isn't
# necessary for bugfix releases. Increasing soversion is required because
# wlroots never guarantees ABI stability -- only API stability is guaranteed
# SceneFX never guarantees ABI stability -- only API stability is guaranteed
# between minor releases.
soversion = 1

Expand Down Expand Up @@ -92,18 +92,22 @@ wayland_server = dependency('wayland-server',
default_options: wayland_project_options,
)

wlroots_options = [ 'examples=false', 'default_library=static' ]
wlroots_options = [ 'examples=false' ]
wlroots_version = ['>=0.17.0', '<0.18.0']
wlroots_is_sub = subproject(
'wlroots',
default_options: wlroots_options,
required: false,
version: wlroots_version,
).found()
wlroots = dependency('wlroots',
version: wlroots_version,
default_options: wlroots_options,
required: false,
)
if not wlroots.found()
wlroots_proj = subproject(
'wlroots',
default_options: wlroots_options,
version: wlroots_version,
)
wlroots = wlroots_proj.get_variable('wlroots')
endif


drm = dependency('libdrm',
version: '>=2.4.114',
Expand Down Expand Up @@ -135,8 +139,8 @@ pixman = dependency('pixman-1',
math = cc.find_library('m')
rt = cc.find_library('rt')

wlr_files = []
wlr_deps = [
scenefx_files = []
scenefx_deps = [
wlroots,
wayland_server,
drm,
Expand All @@ -157,17 +161,17 @@ subdir('include')
scenefx_inc = include_directories('include')

lib_scenefx = library(
meson.project_name(), wlr_files,
meson.project_name(), scenefx_files,
soversion: soversion.to_string(),
dependencies: wlr_deps,
dependencies: scenefx_deps,
include_directories: [ scenefx_inc ],
install: true,
)


scenefx = declare_dependency(
link_with: lib_scenefx,
dependencies: wlr_deps,
dependencies: scenefx_deps,
include_directories: scenefx_inc,
)

Expand Down
8 changes: 1 addition & 7 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
option('xcb-errors', type: 'feature', value: 'auto', description: 'Use xcb-errors util library')
option('xwayland', type: 'feature', value: 'auto', yield: true, description: 'Enable support for X11 applications')
option('examples', type: 'boolean', value: true, description: 'Build example applications')
option('icon_directory', description: 'Location used to look for cursors (default: ${datadir}/icons)', type: 'string', value: '')
option('renderers', type: 'array', choices: ['auto', 'gles2', 'vulkan'], value: ['auto'], description: 'Select built-in renderers')
option('backends', type: 'array', choices: ['auto', 'drm', 'libinput', 'x11'], value: ['auto'], description: 'Select built-in backends')
option('allocators', type: 'array', choices: ['auto', 'gbm'], value: ['auto'],
description: 'Select built-in allocators')
option('renderers', type: 'array', choices: ['auto', 'gles2'], value: ['auto'], description: 'Select built-in renderers')
4 changes: 2 additions & 2 deletions protocol/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ foreach name, path : protocols
output: '@[email protected]',
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
)
wlr_files += code
scenefx_files += code

server_header = custom_target(
name.underscorify() + '_server_h',
input: path,
output: '@[email protected]',
command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'],
)
wlr_files += server_header
scenefx_files += server_header

client_header = custom_target(
name.underscorify() + '_client_h',
Expand Down
2 changes: 1 addition & 1 deletion render/fx_renderer/gles2/shaders/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ shaders = [
foreach name : shaders
output = name.underscorify() + '_src.h'
var = name.underscorify() + '_src'
wlr_files += custom_target(
scenefx_files += custom_target(
output,
command: [embed, var],
input: name,
Expand Down
13 changes: 4 additions & 9 deletions render/fx_renderer/meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
renderers = get_option('renderers')
if 'auto' in renderers and get_option('auto_features').enabled()
renderers = ['gles2', 'vulkan']
renderers = ['gles2']
elif 'auto' in renderers and get_option('auto_features').disabled()
renderers = []
endif

wlr_files += files(
scenefx_files += files(
'matrix.c',
'util.c',
'shaders.c',
'pixel_format.c',
Expand All @@ -16,19 +17,13 @@ wlr_files += files(
'fx_renderer.c',
)

if not wlroots_is_sub
wlr_files += files([
'matrix.c',
])
endif

if 'gles2' in renderers or 'auto' in renderers
egl = dependency('egl', required: 'gles2' in renderers)
gbm = dependency('gbm', required: 'gles2' in renderers)
glesv2 = dependency('glesv2', required: 'gles2' in renderers)

if egl.found() and gbm.found() and glesv2.found()
wlr_deps += [egl, gbm, glesv2]
scenefx_deps += [egl, gbm, glesv2]
endif
subdir('gles2')
endif
Expand Down
2 changes: 1 addition & 1 deletion render/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wlr_files += files(
scenefx_files += files(
'pixel_format.c',
'egl.c',
)
Expand Down
2 changes: 1 addition & 1 deletion types/fx/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wlr_files += files(
scenefx_files += files(
'shadow_data.c',
'blur_data.c',
)
11 changes: 3 additions & 8 deletions types/meson.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
wlr_files += files(
scenefx_files += files(
'scene/wlr_scene.c',
'output/wlr_output.c',
'buffer/buffer.c',
)

if not wlroots_is_sub
wlr_files += files([
'output/wlr_output.c',
'buffer/buffer.c',
])
endif

subdir('fx')
2 changes: 1 addition & 1 deletion util/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wlr_files += files(
scenefx_files += files(
'array.c',
'env.c',
'time.c',
Expand Down