meson: convert gtest to an internal dependency
authorDylan Baker <dylan@pnwbakers.com>
Sun, 1 Oct 2017 03:48:32 +0000 (20:48 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Tue, 3 Oct 2017 17:02:08 +0000 (10:02 -0700)
In truth gtest is an external dependency that upstream expects you to
"vendor" into your own tree. As such, it makes sense to treat it more
like a dependency than an internal library, and collect it's
requirements together in a dependency object.

v2: - include with -isystem instead of setting compiler args (Eric)

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/nir/meson.build
src/gtest/meson.build
src/intel/compiler/meson.build
src/util/tests/string_buffer/meson.build

index c260dca..8a85d11 100644 (file)
@@ -197,8 +197,8 @@ if with_tests
     [files('tests/control_flow_tests.cpp'), nir_opcodes_h],
     c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
     include_directories : [inc_common],
-    dependencies : [dep_thread],
-    link_with : [libmesa_util, libnir, libgtest],
+    dependencies : [dep_thread, idep_gtest],
+    link_with : [libmesa_util, libnir],
   )
 
   test('nir_control_flow', nir_control_flow_test)
index b51504d..91a4924 100644 (file)
@@ -24,3 +24,8 @@ libgtest = static_library(
   include_directories : include_directories('include'),
   build_by_default : false,
 )
+
+idep_gtest = declare_dependency(
+  link_with : libgtest,
+  include_directories : include_directories('include', is_system : true),
+)
index e12fa22..41c2f6e 100644 (file)
@@ -146,9 +146,9 @@ if with_tests
       [t, nir_opcodes_h, ir_expression_operation_h],
       'test_@0@.cpp'.format(t),
       include_directories : [inc_common, inc_intel],
-      link_with : [libgtest, libintel_compiler, libintel_common, libnir,
-                   libmesa_util, libisl],
-      dependencies : [dep_thread, dep_dl],
+      link_with : [libintel_compiler, libintel_common, libnir, libmesa_util,
+                   libisl],
+      dependencies : [dep_thread, dep_dl, idep_gtest],
     )
     test(t, _exe)
   endforeach
index ea9b8a0..14dbebc 100644 (file)
@@ -21,9 +21,9 @@
 string_buffer_test = executable(
   'string_buffer_test',
   'string_buffer_test.cpp',
-  dependencies : [dep_thread, dep_dl],
+  dependencies : [dep_thread, dep_dl, idep_gtest],
   include_directories : inc_common,
-  link_with : [libmesa_util, libgtest],
+  link_with : [libmesa_util],
 )
 
 test('string_buffer', string_buffer_test)