Skip to content

Commit 1ebc659

Browse files
mlandersonjlgMarshMilo100Zach Van Campjwellbelove
authored
Add IWYU pragmas to private headers which provide library symbols (#1103)
* Add Zephyr build system module.yml (#1074) The Zephyr build system requires that modules have a `module.yml` file to specify where the module cmake and kconfig files are located. These can also be explicitly set as "external" meaning that they do not exist within the module tree, itself. These build file can still be specified elsewhere via cmake variables, explained more in-depth here: https://docs.zephyrproject.org/latest/develop/modules.html#modules-module-ext-root This change makes it such that ETL can be included more easily in zephyr projects running on embedded systems. A similar change can be observed in the public nanopb repository, where the repo only requires its own `zephyr/module.yml` file to be found by the zephyr build system, but the kconfig and cmake additions can exist outside of the library repository. * Add full West support for ETL (#1075) This will allow ETL to be included via west in a zephyr build without any additional wrappers or external kconfigs. Signed-off-by: Zach Van Camp <[email protected]> Co-authored-by: Zach Van Camp <[email protected]> * Add IWYU pragmas to private headers which provide library symbols This prevents warnings in clang compiler and IWYU tool https://clangd.llvm.org/guides/include-cleaner#iwyu-pragmas https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-export --------- Signed-off-by: Zach Van Camp <[email protected]> Co-authored-by: Zach Van Camp <[email protected]> Co-authored-by: Zach Van Camp <[email protected]> Co-authored-by: John Wellbelove <[email protected]>
1 parent df90b5d commit 1ebc659

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

include/etl/bitset.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ SOFTWARE.
3434
#include "platform.h"
3535

3636
#if defined(ETL_USE_LEGACY_BITSET)
37-
#include "private/bitset_legacy.h"
37+
#include "private/bitset_legacy.h" // IWYU pragma: export
3838
#else
39-
#include "private/bitset_new.h"
39+
#include "private/bitset_new.h" // IWYU pragma: export
4040
#endif
4141

4242
#endif

include/etl/delegate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ SOFTWARE.
3434
#include "platform.h"
3535

3636
#if ETL_USING_CPP11 && !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION)
37-
#include "private/delegate_cpp11.h"
37+
#include "private/delegate_cpp11.h" // IWYU pragma: export
3838
#else
39-
#include "private/delegate_cpp03.h"
39+
#include "private/delegate_cpp03.h" // IWYU pragma: export
4040
#endif
4141

4242
#endif

include/etl/variant.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ SOFTWARE.
3434
#include "platform.h"
3535

3636
#if ETL_USING_LEGACY_VARIANT
37-
#include "private/variant_legacy.h" // etl::variant
37+
// etl::variant
38+
#include "private/variant_legacy.h" // IWYU pragma: export
3839
#else
39-
#include "private/variant_legacy.h" // etl::legacy::variant
40-
#include "private/variant_variadic.h" // etl::variant
40+
// etl::legacy::variant
41+
#include "private/variant_legacy.h" // IWYU pragma: export
42+
// etl::variant
43+
#include "private/variant_variadic.h" // IWYU pragma: export
4144
#endif
4245

4346
#endif

0 commit comments

Comments
 (0)