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: use disabler feature to convert configuration errors to warnings #11294

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
243 changes: 172 additions & 71 deletions meson.build

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions po/meson.build
@@ -1,6 +1,10 @@
# SPDX-License-Identifier: LGPL-2.1+

i18n = import('i18n')
i18n.gettext(meson.project_name(),
preset : 'glib',
data_dirs : '.')
if find_program('xgettext', required : false).found()
i18n.gettext(meson.project_name(),
preset : 'glib',
data_dirs : '.')
else
warning('Can not do gettext because xgettext is not installed.')
endif
jameshilliard marked this conversation as resolved.
Show resolved Hide resolved
28 changes: 17 additions & 11 deletions src/basic/meson.build
Expand Up @@ -288,17 +288,23 @@ basic_gcrypt_sources = files(
'gcrypt-util.c',
'gcrypt-util.h')

libbasic = static_library(
'basic',
basic_sources,
include_directories : includes,
dependencies : [versiondep,
threads,
libcap,
libselinux,
libm],
c_args : ['-fvisibility=default'],
install : false)
if gperf.found()
libbasic = static_library(
'basic',
basic_sources,
include_directories : includes,
dependencies : [versiondep,
threads,
libcap,
libselinux,
libm],
c_args : ['-fvisibility=default'],
install : false)
have_libbasic = true
else
libbasic = disabler()
have_libbasic = false
endif

# A convenience library that is separate from libbasic to avoid
# unnecessary linking to libgcrypt.
Expand Down
24 changes: 14 additions & 10 deletions src/journal-remote/meson.build
Expand Up @@ -22,16 +22,20 @@ if conf.get('HAVE_MICROHTTPD') == 1
'''.split())
endif

libsystemd_journal_remote = static_library(
'systemd-journal-remote',
libsystemd_journal_remote_sources,
include_directories : includes,
dependencies : [threads,
libmicrohttpd,
libgnutls,
libxz,
liblz4],
install : false)
if gperf.found()
libsystemd_journal_remote = static_library(
'systemd-journal-remote',
libsystemd_journal_remote_sources,
include_directories : includes,
dependencies : [threads,
libmicrohttpd,
libgnutls,
libxz,
liblz4],
install : false)
else
libsystemd_journal_remote = disabler()
endif

systemd_journal_remote_sources = files('''
journal-remote-main.c
Expand Down
8 changes: 8 additions & 0 deletions src/libsystemd/meson.build
@@ -1,5 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1+

# Used to determine if components with libsystemd dependencies are built
if have_libbasic
have_libsystemd = true
else
have_libsystemd = false
warning('libsystemd will not be built')
endif

id128_sources = files('''
sd-id128/id128-util.c
sd-id128/id128-util.h
Expand Down
14 changes: 9 additions & 5 deletions src/login/meson.build
Expand Up @@ -44,11 +44,15 @@ if conf.get('HAVE_ACL') == 1
liblogind_core_sources += logind_acl_c
endif

liblogind_core = static_library(
'logind-core',
liblogind_core_sources,
include_directories : includes,
dependencies : [libacl])
if gperf.found()
liblogind_core = static_library(
'logind-core',
liblogind_core_sources,
include_directories : includes,
dependencies : [libacl])
else
liblogind_core = disabler()
endif

loginctl_sources = files('''
loginctl.c
Expand Down
18 changes: 11 additions & 7 deletions src/nspawn/meson.build
Expand Up @@ -32,13 +32,17 @@ nspawn_gperf_c = custom_target(

libnspawn_core_sources += [nspawn_gperf_c]

libnspawn_core = static_library(
'nspawn-core',
libnspawn_core_sources,
include_directories : includes,
dependencies : [libacl,
libseccomp,
libselinux])
if gperf.found() and libcap.found()
libnspawn_core = static_library(
'nspawn-core',
libnspawn_core_sources,
include_directories : includes,
dependencies : [libacl,
libseccomp,
libselinux])
else
libnspawn_core = disabler()
endif

systemd_nspawn_sources = files('nspawn.c')

Expand Down
15 changes: 10 additions & 5 deletions src/resolve/meson.build
Expand Up @@ -132,11 +132,16 @@ resolved_dnssd_gperf_c = custom_target(
output : 'resolved-dnssd-gperf.c',
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])

libsystemd_resolve_core = static_library(
'systemd-resolve-core',
basic_dns_sources,
dns_type_headers,
include_directories : includes)
if gperf.found()
libsystemd_resolve_core = static_library(
'systemd-resolve-core',
basic_dns_sources,
dns_type_headers,
include_directories : includes)
else
libsystemd_resolve_core = disabler()
endif


systemd_resolved_sources += [resolved_gperf_c, resolved_dnssd_gperf_c]

Expand Down
8 changes: 8 additions & 0 deletions src/shared/meson.build
@@ -1,5 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1+

# Used to determine if components with libshared dependencies are built
if gperf.found() and libcap.found() and libmount.found()
have_libshared = true
else
have_libshared = false
warning('libshared will not be built')
endif

shared_sources = files('''
acl-util.h
acpi-fpdt.c
Expand Down
8 changes: 8 additions & 0 deletions src/udev/meson.build
@@ -1,5 +1,13 @@
# SPDX-License-Identifier: LGPL-2.1+

# Used to determine if components with libudev dependencies are built
if have_libshared
have_libudev = true
else
have_libudev = false
warning('libudev will not be built')
endif

udevadm_sources = files('''
udevadm.c
udevadm.h
Expand Down