gitlab-ci: Merge ccache and libxml2-utils into main apt-get install
[mesa.git] / src / compiler / glsl / glcpp / meson.build
index e6a3dc86753d9485c450b1dca2df47b4c02c9691..9fc8d9d02869e5439c2a797a7fd8cc5d9894b286 100644 (file)
@@ -35,40 +35,54 @@ glcpp_lex = custom_target(
   command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'],
 )
 
+_extra_args = []
+if cpp.get_id() == 'msvc'
+  # Flex relies on __STDC_VERSION__>=199901L to decide when to include C99
+  # inttypes.h.  We always have inttypes.h available with MSVC (either the one
+  # bundled with MSVC 2013, or the one we bundle ourselves), but we can't just
+  # define __STDC_VERSION__ without breaking stuff, as MSVC doesn't fully
+  # support C99.  There's also no way to premptively include stdint.
+  _extra_args += '-FIinttypes.h'
+endif
+
 libglcpp = static_library(
   'glcpp',
-  [glcpp_lex, glcpp_parse, files('glcpp.h', 'pp.c')],
-  link_with : libmesa_util,
+  [glcpp_lex, glcpp_parse, files('glcpp.h', 'pp.c',
+                                 'pp_standalone_scaffolding.c')],
+  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],
+  c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args, _extra_args],
+  cpp_args : [cpp_vis_args, cpp_msvc_compat_args, _extra_args],
   build_by_default : false,
 )
 
 glcpp = executable(
   'glcpp',
   'glcpp.c',
-  dependencies : [dep_m],
+  dependencies : [dep_m, idep_getopt],
   include_directories : [inc_common],
   link_with : [libglcpp, libglsl_util],
   c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args],
   build_by_default : false,
 )
 
-if with_tests
+# FIXME: these fail on windows due to whitespace differences
+if with_any_opengl and with_tests and host_machine.system() != 'windows'
   modes = ['unix', 'windows', 'oldmac', 'bizarro']
-  if dep_valgrind != [] and dep_valgrind.found()
+  if dep_valgrind.found()
     modes += ['valgrind']
   endif
 
   foreach m : modes
     test(
       'glcpp test (@0@)'.format(m),
-      find_program('tests/glcpp_test.py'),
+      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