aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-27 21:48:21 +0200
committerDavid Robillard <d@drobilla.net>2019-07-29 01:59:27 +0200
commit626a49c269351ab47ba8ab1847eae0d13fd62934 (patch)
tree1f1c11186f4f4bc390a3494487dbf57707283ca8
parent560bcf2ad4d73b79d6e9e4c1c7965d7617a3a41d (diff)
downloadpugl-626a49c269351ab47ba8ab1847eae0d13fd62934.tar.gz
pugl-626a49c269351ab47ba8ab1847eae0d13fd62934.tar.bz2
pugl-626a49c269351ab47ba8ab1847eae0d13fd62934.zip
Cleanup: Clean up includes and call IWYU in lint target
-rw-r--r--pugl/detail/implementation.c1
-rw-r--r--pugl/detail/mac.m1
-rw-r--r--pugl/detail/win.c2
-rw-r--r--pugl/detail/x11.c7
-rw-r--r--pugl/detail/x11_cairo.c2
-rw-r--r--pugl/detail/x11_gl.c5
-rw-r--r--test/pugl_cairo_test.c2
-rw-r--r--test/pugl_test.c1
-rw-r--r--wscript9
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 <stdbool.h>
#include <stdlib.h>
#include <string.h>
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 <windows.h>
#include <windowsx.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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 <X11/Xatom.h>
+#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
+#include <sys/time.h>
+
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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 <X11/Xutil.h>
#include <cairo-xlib.h>
#include <cairo.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
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 <GL/gl.h>
#include <GL/glx.h>
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
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 <cairo.h>
-#include <stdint.h>
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
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 <locale.h>
#include <math.h>
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
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):