meson: replace libmesa_util with idep_mesautil
[mesa.git] / src / compiler / glsl / glcpp / meson.build
index 17ee1a242cd55460dd06fd21126615d33dd04dea..5a665444f0697904e03bd15abde410f5005af640 100644 (file)
@@ -22,8 +22,10 @@ glcpp_parse = custom_target(
   'glcpp-parse.[ch]',
   input : 'glcpp-parse.y',
   output : ['glcpp-parse.c', 'glcpp-parse.h'],
-  command : [prog_bison, '-o', '@OUTPUT0@', '-p', 'glcpp_parser_',
-             '--defines=@OUTPUT1@', '@INPUT@'],
+  command : [
+    prog_bison, '-o', '@OUTPUT0@', '-p', 'glcpp_parser_',
+    '--defines=@OUTPUT1@', '@INPUT@',
+  ],
 )
 
 glcpp_lex = custom_target(
@@ -36,7 +38,7 @@ glcpp_lex = custom_target(
 libglcpp = static_library(
   'glcpp',
   [glcpp_lex, glcpp_parse, files('glcpp.h', 'pp.c')],
-  link_with : libmesa_util,
+  dependencies : idep_mesautil,
   include_directories : [inc_common],
   c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args],
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
@@ -53,4 +55,22 @@ glcpp = executable(
   build_by_default : false,
 )
 
-# TODO: figure out how to make all of these tests work.
+if with_any_opengl and with_tests
+  modes = ['unix', 'windows', 'oldmac', 'bizarro']
+  if dep_valgrind.found()
+    modes += ['valgrind']
+  endif
+
+  foreach m : modes
+    test(
+      'glcpp test (@0@)'.format(m),
+      prog_python,
+      args : [
+        join_paths(meson.current_source_dir(), 'tests/glcpp_test.py'),
+        glcpp, join_paths(meson.current_source_dir(), 'tests'),
+        '--@0@'.format(m),
+      ],
+      suite : ['compiler', 'glcpp'],
+    )
+  endforeach
+endif