run: mkosi sandbox -- env CC=clang CXX=clang++ meson setup build
- name: Run clang-tidy
- run: mkosi sandbox -- ninja -C build clang-tidy
+ run: mkosi sandbox -- meson test -C build --suite=clang-tidy --print-errorlogs --no-stdsplit
add_test_setup(
'default',
- exclude_suites : ['integration-tests'],
+ exclude_suites : ['clang-tidy', 'integration-tests'],
is_default : true,
)
objects_by_name = {}
fuzzer_exes = []
generated_sources = [version_h, vmlinux_h_dependency]
+sources = []
# binaries that have --help and are intended for use by humans,
# usually, but not always, installed in /bin.
executables_by_name += { name : exe }
+ if not name.endswith('.standalone')
+ sources += dict.get('sources', [])
+ endif
+
if dict.has_key('extract')
objects_by_name += {
name : {
alias_target('gensources', generated_sources)
-run_clang_tidy = find_program('run-clang-tidy', required : false)
-if run_clang_tidy.found()
- run_target(
- 'clang-tidy',
- command : [
- run_clang_tidy,
- '-use-color',
- '-quiet',
- '-p', meson.project_build_root(),
- # There seems to be a bug in clang-tidy where by even with --quiet some
- # messages from clang's own diagnostics engine leak through:
- # X warnings generated.
- # Until this is fixed upstream, we use -fno-caret-diagnostics to suppress these.
- '-extra-arg=-fno-caret-diagnostics',
- ],
- depends : generated_sources
- )
+clang_tidy = find_program('clang-tidy', required : false)
+if meson.version().version_compare('>=1.4.0')
+ foreach source : sources
+ if fs.name(source).endswith('.h')
+ continue
+ endif
+
+ inputs = [source]
+
+ header = source.full_path().replace('.c', '.h')
+ if fs.exists(header)
+ inputs += header
+ endif
+
+ foreach input : inputs
+ if clang_tidy.found()
+ test(
+ 'clang-tidy-@0@'.format(fs.name(input)),
+ clang_tidy,
+ args : ['-p', meson.project_build_root(), input],
+ suite : 'clang-tidy',
+ depends : generated_sources,
+ )
+ endif
+ endforeach
+ endforeach
endif
check_api_docs_sh = find_program('tools/check-api-docs.sh')
'xattr-util.c',
)
+sources += basic_sources
+
missing_audit_h = files('missing_audit.h')
missing_socket_h = files('missing_socket.h')
#pragma once
#include <sys/resource.h>
+#include <sys/types.h>
#include "macro.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <errno.h>
#include <stdbool.h>
#include <sys/types.h>
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <errno.h>
#include <stdbool.h>
#include "errno-list.h"
systemd_boot_sources += files('bcd.c')
endif
+sources += libefi_sources
+sources += systemd_boot_sources
+sources += stub_sources
+sources += addon_sources
+
boot_targets = []
efi_elf_binaries = []
efi_archspecs = [
restrict_ifaces_skel_h]
endif
+sources += libcore_sources
+
load_fragment_gperf_gperf = custom_target(
'load-fragment-gperf.gperf',
input : 'load-fragment-gperf.gperf.in',
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
'string-util-fundamental.c',
'uki.c',
)
+
+sources += fundamental_sources
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Manager Manager;
-typedef struct StdoutStream StdoutStream;
-typedef struct StreamSyncReq StreamSyncReq;
+#include <sys/socket.h>
+
+#include "sd-event.h"
+#include "sd-id128.h"
#include "fdset.h"
#include "list.h"
+typedef struct ClientContext ClientContext;
+typedef struct Manager Manager;
+typedef struct StdoutStream StdoutStream;
+typedef struct StreamSyncReq StreamSyncReq;
+
typedef enum StdoutStreamState {
STDOUT_STREAM_IDENTIFIER,
STDOUT_STREAM_UNIT_ID,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Manager Manager;
-typedef struct StreamSyncReq StreamSyncReq;
-typedef struct SyncReq SyncReq;
+#include "sd-varlink.h"
#include "journald-stream.h"
#include "list.h"
#include "macro.h"
+typedef struct Manager Manager;
+typedef struct StreamSyncReq StreamSyncReq;
+typedef struct SyncReq SyncReq;
+
/* Encapsulates the synchronization request data we need to keep per STDOUT stream. Primarily a byte counter
* to count down. */
struct StreamSyncReq {
# SPDX-License-Identifier: LGPL-2.1-or-later
-sources = files(
+libsystemd_network_sources = files(
'arp-util.c',
'dhcp-network.c',
'dhcp-option.c',
'sd-radv.c',
)
+sources += libsystemd_network_sources
+
libsystemd_network = static_library(
'systemd-network',
- sources,
+ libsystemd_network_sources,
include_directories : includes,
implicit_include_directories : false,
dependencies : userspace,
+ sd_login_sources + sd_json_sources + sd_varlink_sources \
+ sd_path_sources + sd_netlink_sources + sd_network_sources
+sources += libsystemd_sources
+
libsystemd_c_args = ['-fvisibility=default']
libsystemd_static = static_library(
'libudev.c',
)
+sources += libudev_sources
+
############################################################
libudev_includes = [includes, include_directories('.')]
#include "list.h"
#include "memory-util.h"
+#include "set.h"
#include "string-util.h"
#include "time-util.h"
#include "sd-event.h"
#include "sd-varlink.h"
+#include "assert-util.h"
#include "list.h"
typedef struct Machine Machine;
generated_sources += ethtool_link_mode_h
shared_sources += ethtool_link_mode_h
+sources += shared_sources
fname = 'ethtool-link-mode.xml'
ethtool_link_mode_xml = custom_target(
Author: Auke Kok <auke-jan.h.kok@intel.com>
***/
+#include <errno.h>
#include <stdbool.h>
#include <sys/types.h>
#include <stdbool.h>
#include <sys/types.h>
+#include "assert-util.h"
#include "time-util.h"
#if ENABLE_UTMP
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <errno.h>
#include <inttypes.h>
#include <sys/types.h>