diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2021-02-25 10:52:45 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2021-02-25 10:56:45 +0000 |
commit | 1bec56ea8a931e1ae1c74cc740134497ec365267 (patch) | |
tree | e787a42eb9970a07cc699f27899bf1c6b2098c42 | |
parent | 553c19df16bbc42e8e3dab04bd5f335600b717f4 (diff) |
meson: allow skipping of run check for IPC_RMID_DEFERRED_RELEASE
The run check is particularly annoying in cross-compile scenarios,
so allow bypassing the check by having the user provide the value
via a cross file or native file:
[properties]
ipc_rmid_deferred_release = true
Closes #408
-rw-r--r-- | meson.build | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/meson.build b/meson.build index b1759b5f3..6d5c7dc89 100644 --- a/meson.build +++ b/meson.build @@ -283,13 +283,28 @@ if x11_dep.found() and xext_dep.found() ['X11/extensions/shmstr.h', {'extra-headers': extra_headers}], ] deps += [x11_dep, xext_dep] - res = cc.run(files('meson-cc-tests/ipc_rmid_deferred_release.c'), - dependencies: [x11_dep, xext_dep], - name: 'shmctl IPC_RMID allowes subsequent attaches') - if res.returncode() == 0 - conf.set('IPC_RMID_DEFERRED_RELEASE', 1) + # Can skip the run check by providing the result in a cross file or + # native file as bool property value. + prop = meson.get_external_property('ipc_rmid_deferred_release', 'auto') + # We don't know the type of prop (bool, string) but need to differentiate + # between a set value (bool) or the fallback value (string), so convert to + # a string and chec the string value. + prop_str = '@0@'.format(prop) + if prop_str in ['true', 'false'] + ipc_rmid_deferred_release = (prop_str == 'true') + message('IPC_RMID_DEFERRED_RELEASE:', ipc_rmid_deferred_release) + elif prop_str == 'auto' + res = cc.run(files('meson-cc-tests/ipc_rmid_deferred_release.c'), + dependencies: [x11_dep, xext_dep], + name: 'shmctl IPC_RMID allowes subsequent attaches') + + ipc_rmid_deferred_release = (res.returncode() == 0) + else + error('Unexpected value for external property ipc_rmid_deferred_release: @0@'.format(prop_str)) endif + + conf.set10('IPC_RMID_DEFERRED_RELEASE', ipc_rmid_deferred_release) endif if feature_conf.get('CAIRO_HAS_XLIB_SURFACE', 0) == 1 |