Path: blob/21.2-virgl/src/compiler/glsl/glcpp/meson.build
4547 views
# Copyright © 2017 Intel Corporation12# Permission is hereby granted, free of charge, to any person obtaining a copy3# of this software and associated documentation files (the "Software"), to deal4# in the Software without restriction, including without limitation the rights5# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell6# copies of the Software, and to permit persons to whom the Software is7# furnished to do so, subject to the following conditions:89# The above copyright notice and this permission notice shall be included in10# all copies or substantial portions of the Software.1112# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR13# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,14# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE15# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER16# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,17# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE18# SOFTWARE.1920bison_command = []21if yacc_is_bison22bison_command = [23prog_bison, '-o', '@OUTPUT0@', '-p', 'glcpp_parser_',24'--defines=@OUTPUT1@', '@INPUT@',25]26else27bison_command = [28prog_bison, '-o', '@OUTPUT0@', '-p', 'glcpp_parser_',29'-H', '@OUTPUT1@', '@INPUT@',30]31endif3233glcpp_parse = custom_target(34'glcpp-parse.[ch]',35input : 'glcpp-parse.y',36output : ['glcpp-parse.c', 'glcpp-parse.h'],37command : bison_command38)3940glcpp_lex = custom_target(41'glcpp-lex.c',42input : 'glcpp-lex.l',43output : 'glcpp-lex.c',44command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'],45)4647_extra_args = []48if cpp.get_id() == 'msvc'49# Flex relies on __STDC_VERSION__>=199901L to decide when to include C9950# inttypes.h. We always have inttypes.h available with MSVC (either the one51# bundled with MSVC 2013, or the one we bundle ourselves), but we can't just52# define __STDC_VERSION__ without breaking stuff, as MSVC doesn't fully53# support C99. There's also no way to premptively include stdint.54_extra_args += '-FIinttypes.h'55endif5657libglcpp = static_library(58'glcpp',59[glcpp_lex, glcpp_parse, files('glcpp.h', 'pp.c')],60dependencies : idep_mesautil,61include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],62c_args : [no_override_init_args, c_msvc_compat_args, _extra_args],63cpp_args : [cpp_msvc_compat_args, _extra_args],64gnu_symbol_visibility : 'hidden',65build_by_default : false,66)6768libglcpp_standalone = static_library(69'glcpp_standalone',70'pp_standalone_scaffolding.c',71link_with : libglcpp,72dependencies : idep_mesautil,73include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],74c_args : [no_override_init_args, c_msvc_compat_args, _extra_args],75cpp_args : [cpp_msvc_compat_args, _extra_args],76gnu_symbol_visibility : 'hidden',77build_by_default : false,78)7980glcpp = executable(81'glcpp',82'glcpp.c',83dependencies : [dep_m, idep_getopt, idep_mesautil],84include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],85link_with : [libglcpp_standalone, libglsl_util],86c_args : [no_override_init_args, c_msvc_compat_args],87gnu_symbol_visibility : 'hidden',88build_by_default : false,89)9091# FIXME: these fail on windows due to whitespace differences92if with_any_opengl and with_tests and host_machine.system() != 'windows'93modes = ['unix', 'windows', 'oldmac', 'bizarro']9495foreach m : modes96test(97'glcpp test (@0@)'.format(m),98prog_python,99args : [100join_paths(meson.current_source_dir(), 'tests/glcpp_test.py'),101glcpp, join_paths(meson.current_source_dir(), 'tests'),102'--@0@'.format(m),103],104suite : ['compiler', 'glcpp'],105timeout: 60,106)107endforeach108109if dep_valgrind.found()110test(111'glcpp test (valgrind)',112prog_python,113args : [114join_paths(meson.current_source_dir(), 'tests/glcpp_test.py'),115glcpp, join_paths(meson.current_source_dir(), 'tests'),116'--valgrind',117],118suite : ['compiler', 'glcpp'],119timeout: 240,120)121endif122endif123124125