From 626a49c269351ab47ba8ab1847eae0d13fd62934 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 27 Jul 2019 21:48:21 +0200 Subject: Cleanup: Clean up includes and call IWYU in lint target --- pugl/detail/implementation.c | 1 + pugl/detail/mac.m | 1 + pugl/detail/win.c | 2 ++ pugl/detail/x11.c | 7 ++++++- pugl/detail/x11_cairo.c | 2 ++ pugl/detail/x11_gl.c | 5 +++++ test/pugl_cairo_test.c | 2 +- test/pugl_test.c | 1 + wscript | 9 +++++++-- 9 files changed, 26 insertions(+), 4 deletions(-) diff --git a/pugl/detail/implementation.c b/pugl/detail/implementation.c index fd7ce81..45e21c5 100644 --- a/pugl/detail/implementation.c +++ b/pugl/detail/implementation.c @@ -21,6 +21,7 @@ #include "pugl/detail/implementation.h" #include "pugl/pugl.h" +#include #include #include diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m index 83adcd1..78a6d39 100644 --- a/pugl/detail/mac.m +++ b/pugl/detail/mac.m @@ -23,6 +23,7 @@ #include "pugl/detail/implementation.h" #include "pugl/gl.h" +#include "pugl/pugl.h" #include "pugl/pugl_gl_backend.h" #ifdef PUGL_HAVE_CAIRO diff --git a/pugl/detail/win.c b/pugl/detail/win.c index cd7a781..6b56c07 100644 --- a/pugl/detail/win.c +++ b/pugl/detail/win.c @@ -20,10 +20,12 @@ #include "pugl/detail/implementation.h" #include "pugl/detail/win.h" +#include "pugl/pugl.h" #include #include +#include #include #include #include diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c index 8b4c136..a076d6f 100644 --- a/pugl/detail/x11.c +++ b/pugl/detail/x11.c @@ -24,12 +24,17 @@ #include "pugl/detail/implementation.h" #include "pugl/detail/x11.h" +#include "pugl/pugl.h" -#include +#include #include #include #include +#include + +#include +#include #include #include #include diff --git a/pugl/detail/x11_cairo.c b/pugl/detail/x11_cairo.c index 97624a2..787c111 100644 --- a/pugl/detail/x11_cairo.c +++ b/pugl/detail/x11_cairo.c @@ -20,12 +20,14 @@ #include "pugl/detail/types.h" #include "pugl/detail/x11.h" +#include "pugl/pugl.h" #include "pugl/pugl_cairo_backend.h" #include #include #include +#include #include #include diff --git a/pugl/detail/x11_gl.c b/pugl/detail/x11_gl.c index 929d3a5..6ed8622 100644 --- a/pugl/detail/x11_gl.c +++ b/pugl/detail/x11_gl.c @@ -20,11 +20,16 @@ #include "pugl/detail/implementation.h" #include "pugl/detail/x11.h" +#include "pugl/pugl.h" #include "pugl/pugl_gl_backend.h" #include #include +#include +#include +#include +#include #include #include diff --git a/test/pugl_cairo_test.c b/test/pugl_cairo_test.c index 57f27ec..cd5e5b3 100644 --- a/test/pugl_cairo_test.c +++ b/test/pugl_cairo_test.c @@ -23,7 +23,7 @@ #include -#include +#include #include #include diff --git a/test/pugl_test.c b/test/pugl_test.c index b83263f..f81cf99 100644 --- a/test/pugl_test.c +++ b/test/pugl_test.c @@ -28,6 +28,7 @@ #include #include +#include #include #include diff --git a/wscript b/wscript index 6d44282..7fd5a3a 100644 --- a/wscript +++ b/wscript @@ -3,7 +3,7 @@ import os import sys -from waflib import Options, TaskGen +from waflib import Logs, Options, TaskGen from waflib.extras import autowaf # Library and package version (UNIX style major, minor, micro) @@ -127,7 +127,7 @@ def build(bld): common = { 'framework': framework, - 'includes': ['.', './src'], + 'includes': ['.'], 'uselib': ['CAIRO'], } @@ -229,6 +229,11 @@ def lint(ctx): subprocess.call(cmd, cwd='build', shell=True) + try: + subprocess.call(['iwyu_tool.py', '-o', 'clang', '-p', 'build']) + except Exception: + Logs.warn('Failed to call iwyu_tool.py') + # Alias .m files to be compiled like .c files, gcc will do the right thing. @TaskGen.extension('.m') def m_hook(self, node): -- cgit v1.2.1