diff options
author | Jose Fonseca <[email protected]> | 2015-03-19 11:53:36 +0000 |
---|---|---|
committer | Jose Fonseca <[email protected]> | 2015-03-22 08:23:24 +0000 |
commit | 015e8b6384bbdba8421c5dafd4783dba4d3a9182 (patch) | |
tree | 2feec96fc41b86480bd090c8adbaff594b4ca5ac | |
parent | 357d1fc81aceec6dda866ea74962ee2ddf3aa350 (diff) |
scons: Define YY_USE_CONST on MSVC.
This prevents the MSVC from
warning C4090: 'function' : different 'const' qualifiers
when compiling flex generated lexers.
Reviewed-by: Brian Paul <[email protected]>
-rwxr-xr-x | scons/gallium.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scons/gallium.py b/scons/gallium.py index 2b115267a8e..9924f1e7dce 100755 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -622,6 +622,14 @@ def generate(env): # Load tools env.Tool('lex') + if env['msvc']: + env.Append(LEXFLAGS = [ + # Force flex to use const keyword in prototypes, as relies on + # __cplusplus or __STDC__ macro to determine whether it's safe to + # use const keyword, but MSVC never defines __STDC__ unless we + # disable all MSVC extensions. + '-DYY_USE_CONST=', + ]) env.Tool('yacc') if env['llvm']: env.Tool('llvm') |