Skip to content

Commit 95ae0a2

Browse files
authored
Add IWYU export pragmas to protect internal headers (#756)
Include What You Use tries to add the internal nanobind headers to files using nanobind.h. Tell it that it should rely on nanobind.h to export all of the internal symbols using the `export` pragma. https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-export
1 parent bbbd022 commit 95ae0a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/nanobind/nanobind.h

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <new>
3737

3838
// Implementation. The nb_*.h files should only be included through nanobind.h
39+
// IWYU pragma: begin_exports
3940
#include "nb_python.h"
4041
#include "nb_defs.h"
4142
#include "nb_enums.h"
@@ -52,6 +53,7 @@
5253
#include "nb_call.h"
5354
#include "nb_func.h"
5455
#include "nb_class.h"
56+
// IWYU pragma: end_exports
5557

5658
#if defined(_MSC_VER)
5759
# pragma warning(pop)

0 commit comments

Comments
 (0)