2016-11-24 18:54:51 +03:00
|
|
|
project('weston',
|
|
|
|
'c',
|
2024-08-28 10:40:07 +03:00
|
|
|
version: '13.0.93',
|
2016-11-24 18:54:51 +03:00
|
|
|
default_options: [
|
2019-06-11 13:41:41 +03:00
|
|
|
'warning_level=3',
|
2016-11-24 18:54:51 +03:00
|
|
|
'c_std=gnu99',
|
2019-07-09 12:06:42 +03:00
|
|
|
'b_lundef=true',
|
2016-11-24 18:54:51 +03:00
|
|
|
],
|
2023-01-24 19:17:58 +03:00
|
|
|
meson_version: '>= 0.63.0',
|
2016-11-24 18:54:51 +03:00
|
|
|
license: 'MIT/Expat',
|
|
|
|
)
|
|
|
|
|
2024-01-08 15:54:39 +03:00
|
|
|
libweston_major = 14
|
2016-11-24 18:54:51 +03:00
|
|
|
|
|
|
|
# libweston_revision is manufactured to follow the autotools build's
|
|
|
|
# library file naming, thanks to libtool
|
|
|
|
version_weston = meson.project_version()
|
|
|
|
version_weston_arr = version_weston.split('.')
|
|
|
|
if libweston_major > version_weston_arr[0].to_int()
|
|
|
|
if libweston_major > version_weston_arr[0].to_int() + 1
|
|
|
|
error('Bad versions in meson.build: libweston_major is too high')
|
|
|
|
endif
|
|
|
|
libweston_revision = 0
|
|
|
|
elif libweston_major == version_weston_arr[0].to_int()
|
|
|
|
libweston_revision = version_weston_arr[2].to_int()
|
|
|
|
else
|
|
|
|
error('Bad versions in meson.build: libweston_major is too low')
|
|
|
|
endif
|
|
|
|
|
|
|
|
dir_prefix = get_option('prefix')
|
2023-06-22 16:28:52 +03:00
|
|
|
dir_bin = dir_prefix / get_option('bindir')
|
|
|
|
dir_data = dir_prefix / get_option('datadir')
|
2016-11-24 18:54:51 +03:00
|
|
|
dir_include_libweston = 'libweston-@0@'.format(libweston_major)
|
2023-06-22 16:28:52 +03:00
|
|
|
dir_include_libweston_install = dir_include_libweston / 'libweston'
|
|
|
|
dir_lib = dir_prefix /get_option('libdir')
|
|
|
|
dir_libexec = dir_prefix / get_option('libexecdir')
|
|
|
|
dir_module_weston = dir_lib / 'weston'
|
|
|
|
dir_module_libweston = dir_lib / 'libweston-@0@'.format(libweston_major)
|
|
|
|
dir_data_pc = dir_data / 'pkgconfig'
|
|
|
|
dir_lib_pc = dir_lib / 'pkgconfig'
|
|
|
|
dir_man = dir_prefix / get_option('mandir')
|
|
|
|
dir_protocol_libweston = 'libweston-@0@'.format(libweston_major) / 'protocols'
|
|
|
|
dir_sysconf = dir_prefix / get_option('sysconfdir')
|
2023-06-21 15:49:08 +03:00
|
|
|
dir_gitlab_ci = meson.project_source_root() / '.gitlab-ci'
|
2016-11-24 18:54:51 +03:00
|
|
|
|
2019-03-28 17:35:56 +03:00
|
|
|
public_inc = include_directories('include')
|
2019-04-05 17:09:28 +03:00
|
|
|
common_inc = [ include_directories('.'), public_inc ]
|
2019-03-28 17:35:56 +03:00
|
|
|
|
2016-11-24 18:54:51 +03:00
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
|
|
|
|
git_version_h = vcs_tag(
|
|
|
|
input: 'libweston/git-version.h.meson',
|
|
|
|
output: 'git-version.h',
|
|
|
|
fallback: version_weston
|
|
|
|
)
|
|
|
|
|
|
|
|
config_h = configuration_data()
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
2022-09-22 16:22:30 +03:00
|
|
|
global_args = cc.get_supported_arguments(
|
2020-01-27 02:24:44 +03:00
|
|
|
'-Wmissing-prototypes',
|
2019-01-10 17:57:05 +03:00
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Wno-shift-negative-value', # required due to Pixman
|
|
|
|
'-Wno-missing-field-initializers',
|
2019-06-11 13:40:13 +03:00
|
|
|
'-Wno-pedantic',
|
2021-03-03 15:01:40 +03:00
|
|
|
'-Wundef',
|
2016-11-24 18:54:51 +03:00
|
|
|
'-fvisibility=hidden',
|
2022-09-22 16:22:30 +03:00
|
|
|
)
|
2023-04-28 13:56:16 +03:00
|
|
|
add_project_arguments(global_args, language: 'c')
|
2016-11-24 18:54:51 +03:00
|
|
|
|
|
|
|
if cc.has_header_symbol('sys/sysmacros.h', 'major')
|
|
|
|
config_h.set('MAJOR_IN_SYSMACROS', 1)
|
|
|
|
elif cc.has_header_symbol('sys/mkdev.h', 'major')
|
|
|
|
config_h.set('MAJOR_IN_MKDEV', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
optional_libc_funcs = [
|
2022-12-29 23:06:07 +03:00
|
|
|
'mkostemp', 'strchrnul', 'initgroups', 'posix_fallocate',
|
|
|
|
'memfd_create', 'unreachable',
|
2016-11-24 18:54:51 +03:00
|
|
|
]
|
|
|
|
foreach func : optional_libc_funcs
|
|
|
|
if cc.has_function(func)
|
|
|
|
config_h.set('HAVE_' + func.to_upper(), 1)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
optional_system_headers = [
|
|
|
|
'linux/sync_file.h'
|
|
|
|
]
|
|
|
|
foreach hdr : optional_system_headers
|
|
|
|
if cc.has_header(hdr)
|
|
|
|
config_h.set('HAVE_' + hdr.underscorify().to_upper(), 1)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2024-04-30 20:48:56 +03:00
|
|
|
optional_builtins = {
|
|
|
|
'builtin_clz': 'return __builtin_clz(1);',
|
|
|
|
'builtin_bswap32': 'return __builtin_bswap32(0);',
|
|
|
|
'builtin_popcount': 'return __builtin_popcount(0);',
|
|
|
|
}
|
|
|
|
foreach name, check : optional_builtins
|
|
|
|
if cc.links('int main(void) { @0@ }'.format(check), name: name)
|
|
|
|
config_h.set('HAVE_' + name.to_upper(), 1)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2016-11-24 18:54:51 +03:00
|
|
|
env_modmap = ''
|
|
|
|
|
|
|
|
config_h.set('_GNU_SOURCE', '1')
|
|
|
|
config_h.set('_ALL_SOURCE', '1')
|
2020-01-24 16:11:13 +03:00
|
|
|
config_h.set('EGL_NO_X11', '1')
|
|
|
|
config_h.set('MESA_EGL_NO_X11_HEADERS', '1')
|
2020-10-23 23:39:35 +03:00
|
|
|
config_h.set('EGL_NO_PLATFORM_SPECIFIC_TYPES', '1')
|
2016-11-24 18:54:51 +03:00
|
|
|
|
|
|
|
config_h.set_quoted('PACKAGE_STRING', 'weston @0@'.format(version_weston))
|
|
|
|
config_h.set_quoted('PACKAGE_VERSION', version_weston)
|
|
|
|
config_h.set_quoted('VERSION', version_weston)
|
|
|
|
config_h.set_quoted('PACKAGE_URL', 'https://wayland.freedesktop.org')
|
|
|
|
config_h.set_quoted('PACKAGE_BUGREPORT', 'https://gitlab.freedesktop.org/wayland/weston/issues/')
|
|
|
|
|
|
|
|
config_h.set_quoted('BINDIR', dir_bin)
|
|
|
|
config_h.set_quoted('DATADIR', dir_data)
|
|
|
|
config_h.set_quoted('LIBEXECDIR', dir_libexec)
|
|
|
|
config_h.set_quoted('MODULEDIR', dir_module_weston)
|
|
|
|
config_h.set_quoted('LIBWESTON_MODULEDIR', dir_module_libweston)
|
|
|
|
|
|
|
|
backend_default = get_option('backend-default')
|
|
|
|
if backend_default == 'auto'
|
2022-02-05 02:43:50 +03:00
|
|
|
foreach b : [ 'headless', 'x11', 'wayland', 'drm' ]
|
2016-11-24 18:54:51 +03:00
|
|
|
if get_option('backend-' + b)
|
|
|
|
backend_default = b
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
endif
|
2022-12-05 19:28:23 +03:00
|
|
|
config_h.set_quoted('WESTON_NATIVE_BACKEND', backend_default)
|
2016-11-24 18:54:51 +03:00
|
|
|
message('The default backend is ' + backend_default)
|
|
|
|
if not get_option('backend-' + backend_default)
|
|
|
|
error('Backend @0@ was chosen as native but is not being built.'.format(backend_default))
|
|
|
|
endif
|
|
|
|
|
|
|
|
dep_xkbcommon = dependency('xkbcommon', version: '>= 0.3.0')
|
|
|
|
if dep_xkbcommon.version().version_compare('>= 0.5.0')
|
|
|
|
config_h.set('HAVE_XKBCOMMON_COMPOSE', '1')
|
|
|
|
endif
|
|
|
|
|
2023-05-02 14:47:22 +03:00
|
|
|
dep_wayland_server = dependency('wayland-server', version: '>= 1.22.0')
|
|
|
|
dep_wayland_client = dependency('wayland-client', version: '>= 1.22.0')
|
2016-11-24 18:54:51 +03:00
|
|
|
dep_pixman = dependency('pixman-1', version: '>= 0.25.2')
|
2021-01-20 11:21:29 +03:00
|
|
|
dep_libinput = dependency('libinput', version: '>= 1.2.0')
|
weston: add more libinput config options
This is so that, for instance, people using weston as their main Wayland
compositor can invert the sense of two finger scrolling or change
pointer acceleration using weston.ini, rather than having to edit C
code.
All of the options that libinput itself exposes through its API are now
exposed in weston.ini. The new options are called `tap-and-drag`,
`tap-and-drag-lock`, `disable-while-typing`, `middle-emulation`,
`left-handed`, `rotation`, `accel-profile`, `accel-speed`,
`scroll-method`, `natural-scroll`, and `scroll-button`. I have
successfully tested everything except for `rotation`, out of a lack of
hardware support.
weston now depends directly on libevdev for turning button name strings into
kernel input codes. This was needed for the `scroll-button` config
option. (weston already depends indirectly on libevdev through
libinput, so I figured people would be OK with this.) As a practical
matter for debian-style packagers, weston now has a build dependency on
libevdev-dev.
Right now, the code applies the same options to all attached devices
that a given option is relevant for. There are plans for multiple
[libinput] sections, each with different device filters, for users who
need more control here.
Signed-off-by: Eric Toombs <3672-ewtoombs@users.noreply.gitlab.freedesktop.org>
2019-02-01 05:53:25 +03:00
|
|
|
dep_libevdev = dependency('libevdev')
|
2016-11-24 18:54:51 +03:00
|
|
|
dep_libm = cc.find_library('m')
|
|
|
|
dep_libdl = cc.find_library('dl')
|
2022-02-23 01:56:42 +03:00
|
|
|
dep_libdrm = dependency('libdrm', version: '>= 2.4.108')
|
2016-11-24 18:54:51 +03:00
|
|
|
dep_libdrm_headers = dep_libdrm.partial_dependency(compile_args: true)
|
|
|
|
dep_threads = dependency('threads')
|
|
|
|
|
2022-05-20 14:29:47 +03:00
|
|
|
dep_lcms2 = dependency('lcms2', version: '>= 2.9', required: false)
|
2024-01-09 21:42:41 +03:00
|
|
|
if dep_lcms2.found()
|
|
|
|
config_h.set('HAVE_LCMS', '1')
|
|
|
|
endif
|
2022-05-20 14:29:47 +03:00
|
|
|
|
2020-11-25 14:22:26 +03:00
|
|
|
prog_python = import('python').find_installation('python3')
|
|
|
|
files_xxd_py = files('tools/xxd.py')
|
|
|
|
cmd_xxd = [ prog_python, files_xxd_py, '@INPUT@', '@OUTPUT@' ]
|
|
|
|
|
2023-05-18 10:17:17 +03:00
|
|
|
deps_for_libweston_users = [
|
|
|
|
dep_wayland_server,
|
|
|
|
dep_pixman,
|
|
|
|
dep_xkbcommon,
|
|
|
|
]
|
|
|
|
|
2024-03-16 00:59:50 +03:00
|
|
|
if get_option('renderer-gl')
|
|
|
|
dep_egl = dependency('egl', required: false)
|
|
|
|
if not dep_egl.found()
|
|
|
|
error('libweston + gl-renderer requires egl which was not found. Or, you can use \'-Drenderer-gl=false\'.')
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
dep_egl = dependency('', required: false)
|
|
|
|
endif
|
|
|
|
|
2023-05-18 10:17:17 +03:00
|
|
|
|
2019-03-28 17:35:56 +03:00
|
|
|
subdir('include')
|
2016-11-24 18:54:51 +03:00
|
|
|
subdir('protocol')
|
|
|
|
subdir('shared')
|
|
|
|
subdir('libweston')
|
|
|
|
subdir('xwayland')
|
2023-12-15 15:20:18 +03:00
|
|
|
subdir('frontend')
|
2016-11-24 18:54:51 +03:00
|
|
|
subdir('desktop-shell')
|
|
|
|
subdir('fullscreen-shell')
|
|
|
|
subdir('ivi-shell')
|
2020-04-21 18:23:37 +03:00
|
|
|
subdir('kiosk-shell')
|
2016-11-24 18:54:51 +03:00
|
|
|
subdir('remoting')
|
2019-04-23 13:34:05 +03:00
|
|
|
subdir('pipewire')
|
2016-11-24 18:54:51 +03:00
|
|
|
subdir('clients')
|
|
|
|
subdir('wcap')
|
2024-07-06 10:23:33 +03:00
|
|
|
if get_option('tests')
|
|
|
|
subdir('tests')
|
|
|
|
endif
|
2016-11-24 18:54:51 +03:00
|
|
|
subdir('data')
|
|
|
|
subdir('man')
|
2022-11-19 11:52:01 +03:00
|
|
|
subdir('pam')
|
2016-11-24 18:54:51 +03:00
|
|
|
|
2022-09-06 19:07:27 +03:00
|
|
|
if meson.version().version_compare('>= 0.58.0')
|
|
|
|
devenv = environment()
|
|
|
|
devenv.set('WESTON_MODULE_MAP', env_modmap)
|
2023-06-22 16:28:52 +03:00
|
|
|
devenv.set('WESTON_DATA_DIR', meson.current_source_dir() / 'data')
|
2022-09-06 19:07:27 +03:00
|
|
|
meson.add_devenv(devenv)
|
|
|
|
endif
|
|
|
|
|
2019-04-16 08:11:01 +03:00
|
|
|
configure_file(output: 'config.h', configuration: config_h)
|
|
|
|
|
2019-06-14 12:41:02 +03:00
|
|
|
if get_option('doc')
|
|
|
|
subdir('doc/sphinx')
|
|
|
|
else
|
|
|
|
message('Documentation will not be built. Use -Ddoc to build it.')
|
|
|
|
endif
|