[Mesa-dev] [PATCH 1/8] glapi: don't walk backwards for includes

Dylan Baker dylan at pnwbakers.com
Mon Nov 20 23:12:45 UTC 2017


Instead just set the proper -I flags and include it from a more standard
path. In this case we'll add -Isrc/mesa (which is common), and #include
main/foo.h.
---
 src/mapi/Makefile.am                 | 3 ++-
 src/mapi/glapi/meson.build           | 1 +
 src/mapi/glapi/tests/check_table.cpp | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mapi/Makefile.am b/src/mapi/Makefile.am
index 3f8fcc02e55..015edc37cb3 100644
--- a/src/mapi/Makefile.am
+++ b/src/mapi/Makefile.am
@@ -87,7 +87,8 @@ check_PROGRAMS += shared-glapi-test
 shared_glapi_test_SOURCES = shared-glapi/tests/check_table.cpp
 shared_glapi_test_CPPFLAGS = \
 	$(AM_CPPFLAGS) \
-	-I$(top_srcdir)/src/gtest/include
+	-I$(top_srcdir)/src/gtest/include \
+	-I$(top_srcdir)/src/mesa
 shared_glapi_test_LDADD = \
 	$(top_builddir)/src/mapi/shared-glapi/libglapi.la \
 	$(top_builddir)/src/gtest/libgtest.la
diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build
index d2d86afd6c1..892d8b35759 100644
--- a/src/mapi/glapi/meson.build
+++ b/src/mapi/glapi/meson.build
@@ -79,6 +79,7 @@ if not with_shared_glapi and with_tests
   glapi_static_check_table = executable(
     'glapi_static_check_table',
     'tests/check_table.cpp',
+    include_directories : inc_mesa,
     link_with : [libglapi_static],
     dependencies : [idep_gtest],
   )
diff --git a/src/mapi/glapi/tests/check_table.cpp b/src/mapi/glapi/tests/check_table.cpp
index 09bf4f3585c..62b3a43d22f 100644
--- a/src/mapi/glapi/tests/check_table.cpp
+++ b/src/mapi/glapi/tests/check_table.cpp
@@ -22,7 +22,7 @@
  */
 
 #include <gtest/gtest.h>
-#include "../mesa/main/glheader.h"
+#include "main/glheader.h"
 
 extern "C" {
 #include "glapi/glapi.h"
-- 
2.15.0



More information about the mesa-dev mailing list