From 270fa6d8739a078fede61de92748928faa9d8164 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Mon, 11 Nov 2019 17:22:50 +0000
Subject: [PATCH] build: Consistently use project_include_dirs everywhere

This matters when invoked as a subproject, for example by
pressure-vessel, in which case we don't get -I$(top_builddir).

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 helpers/meson.build |  3 +++
 tests/meson.build   | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/helpers/meson.build b/helpers/meson.build
index f0f475a59..80b6a2182 100644
--- a/helpers/meson.build
+++ b/helpers/meson.build
@@ -24,6 +24,7 @@
 executable(
   multiarch + '-true',
   'true.c',
+  include_directories : project_include_dirs,
   install : true,
   install_dir : pkglibexecdir,
   # Deliberately no RPATH/RUNPATH here: it's unnecessary because this
@@ -46,6 +47,7 @@ executable(
   multiarch + '-inspect-library',
   'inspect-library.c',
   dependencies : [libdl],
+  include_directories : project_include_dirs,
   install : true,
   install_dir : pkglibexecdir,
   # Deliberately no RPATH/RUNPATH here: we want to determine whether
@@ -56,6 +58,7 @@ executable(
   multiarch + '-check-vulkan',
   'check-vulkan.cpp',
   dependencies : [vulkan, xcb],
+  include_directories : project_include_dirs,
   install : true,
   install_dir : join_paths(
     get_option('libexecdir'),
diff --git a/tests/meson.build b/tests/meson.build
index 784f33db5..bfd2354aa 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -65,6 +65,7 @@ install_subdir('sysroots', install_dir : tests_dir)
 executable(
   'mock-true',
   join_paths('..', 'helpers', 'true.c'),
+  include_directories : project_include_dirs,
   install : get_option('installed_tests'),
   install_dir : tests_dir,
 )
@@ -77,6 +78,7 @@ foreach test_name : tests
       '-D_SRT_MULTIARCH="' + multiarch + '"',
     ],
     dependencies : [glib, gobject, libsteamrt_dep, json_glib],
+    include_directories : project_include_dirs,
     install : get_option('installed_tests'),
     install_dir : tests_dir,
   )
@@ -146,6 +148,7 @@ executable(
 executable(
   'mock-good-wflinfo',
   'mock-good-wflinfo.c',
+  include_directories : project_include_dirs,
   install: true,
   install_dir: tests_dir
 )
@@ -153,6 +156,7 @@ executable(
 executable(
   'mock-hanging-wflinfo',
   'mock-hanging-wflinfo.c',
+  include_directories : project_include_dirs,
   install: true,
   install_dir: tests_dir
 )
@@ -160,6 +164,7 @@ executable(
 executable(
   'mock-bad-wflinfo',
   'mock-bad-wflinfo.c',
+  include_directories : project_include_dirs,
   install: true,
   install_dir: tests_dir
 )
@@ -167,6 +172,7 @@ executable(
 executable(
   'mock-software-wflinfo',
   'mock-software-wflinfo.c',
+  include_directories : project_include_dirs,
   install: true,
   install_dir: tests_dir
 )
@@ -174,6 +180,7 @@ executable(
 executable(
   'mock-good-vulkaninfo',
   'mock-good-vulkaninfo.c',
+  include_directories : project_include_dirs,
   install: true,
   install_dir: tests_dir
 )
@@ -181,6 +188,7 @@ executable(
 executable(
   'mock-bad-vulkaninfo',
   'mock-bad-vulkaninfo.c',
+  include_directories : project_include_dirs,
   install: true,
   install_dir: tests_dir
 )
@@ -188,6 +196,7 @@ executable(
 executable(
   'mock-good-check-vulkan',
   join_paths('..', 'helpers', 'true.c'),
+  include_directories : project_include_dirs,
   install: true,
   install_dir: tests_dir
 )
@@ -195,6 +204,7 @@ executable(
 executable(
   'mock-bad-check-vulkan',
   'mock-bad-check-vulkan.c',
+  include_directories : project_include_dirs,
   install: true,
   install_dir: tests_dir
 )
@@ -202,6 +212,7 @@ executable(
 executable(
   'mock-mixed-vulkaninfo',
   'mock-good-vulkaninfo.c',
+  include_directories : project_include_dirs,
   install: true,
   install_dir: tests_dir
 )
@@ -209,6 +220,7 @@ executable(
 executable(
   'mock-mixed-check-vulkan',
   'mock-bad-check-vulkan.c',
+  include_directories : project_include_dirs,
   install: true,
   install_dir: tests_dir
 )
-- 
GitLab