Branch: refs/heads/master
Home:
https://github.com/Checkmk/checkmk
Commit: 80bc5b62ecadae5c1241f8469d4b6b15853f8ade
https://github.com/Checkmk/checkmk/commit/80bc5b62ecadae5c1241f8469d4b6b158…
Author: Sven Panne <sven.panne(a)checkmk.com>
Date: 2024-08-06 (Tue, 06 Aug 2024)
Changed paths:
M .clang-tidy
M omd/packages/asio/BUILD.asio.bazel
M packages/livestatus/BUILD
M packages/neb/BUILD
Log Message:
-----------
Fixed paths to includes
Tricky stuff ahead! If you do the following:
cc_library(
...
srcs = ["blah/bar.cc"],
hdrs = ["foo/bar.h"],
includes = ["foo"],
...
)
the "foo" will end up as "-isystem <some_path>/foo" on the
compiler commandline. This means that '#include <bar.h>'
will work, and '#include "bar.h"', too. For the normal
C/C++ compiler this doesn't really make a difference (apart
from the handling of name clashes), but for IWYU it does: It
doesn't consider bar.h as the header belonging to bar.cc
anymore, so it will insist on adding headers already
mentioned in bar.h. The solution is actually simple,
although non-obvious, namely using Bazel's virtual includes:
instead:
cc_library(
...
srcs = ["blah/bar.cc"],
hdrs = ["foo/bar.h"],
strip_include_prefix = ["foo/"],
...
)
See e.g.
https://www.alexanderneben.com/2021/10/05/bazel-part-1.html
Change-Id: I7e3f3e5314bef53f567c69b0ab1e520a91492143
To unsubscribe from these emails, change your notification settings at
https://github.com/Checkmk/checkmk/settings/notifications