diff options
author | Dylan Baker <[email protected]> | 2018-05-23 10:05:20 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2019-10-10 16:33:04 -0700 |
commit | 150aec5d1f2ed6599eabbda5e92354d6846dc0bc (patch) | |
tree | 9ed9348dffbff902922e76b8674cee830f0bd060 | |
parent | 8b19c5b145592314a63569d7ba3f0e10df84a5cf (diff) |
meson: force inclusion of inttypes.h for glcpp with msvc
Because we provide a copy if MSVC doesn't, and we need it to make flex
do what we want.
Acked-by: Kristian H. Kristensen <[email protected]>
-rw-r--r-- | src/compiler/glsl/glcpp/meson.build | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/compiler/glsl/glcpp/meson.build b/src/compiler/glsl/glcpp/meson.build index 5a665444f06..90046477108 100644 --- a/src/compiler/glsl/glcpp/meson.build +++ b/src/compiler/glsl/glcpp/meson.build @@ -35,13 +35,23 @@ 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')], 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, ) |