Commit 3218056e authored by Dylan Baker's avatar Dylan Baker

meson: Build i965 and dri stack

This gets pretty much the entire classic tree building, as well as
i965, including the various glapis. There are some workarounds for bugs
that are fixed in meson 0.43.0, which is due out on October 8th.

I have tested this with piglit using glx.

v2: - fix typo "vaule" -> "value"
    - use gtest dep instead of linking to libgtest (rebase error)
    - use gtest dep instead of linking against libgtest (rebase error)
    - copy the megadriver, then create hard links from that, then delete
      the megadriver. This matches the behavior of the autotools build.
      (Eric A)
    - Use host_machine instead of target_machine (Eric A)
    - Put a comment in the right place (Eric A)
    - Don't have two variables for the same information (Eric A)
    - Put pre_args at top of file in this patch (Eric A)
    - Fix glx generators in this patch instead of next (Eric A)
    - Remove -DMESON hack (Eric A)
    - add sha1_h to mesa in this patch (Eric A)
    - Put generators in loops when possible to reduce code in
      mapi/glapi/gen (Eric A)
v3: - put HAVE_X11_PLATFORM in this patch
Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
parent 86eb09a1
#!/usr/bin/env python
# encoding=utf-8
# Copyright © 2017 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Script to install megadriver symlinks for meson."""
from __future__ import print_function
import argparse
import os
import shutil
def main():
parser = argparse.ArgumentParser()
parser.add_argument('megadriver')
parser.add_argument('libdir')
parser.add_argument('drivers', nargs='+')
args = parser.parse_args()
to = os.path.join(os.environ.get('MESON_INSTALL_DESTDIR_PREFIX'), args.libdir)
master = os.path.join(to, os.path.basename(args.megadriver))
if not os.path.exists(to):
os.makedirs(to)
shutil.copy(args.megadriver, master)
for each in args.drivers:
driver = os.path.join(to, each)
if os.path.exists(driver):
os.unlink(driver)
print('installing {} to {}'.format(args.megadriver, to))
os.link(master, driver)
os.unlink(master)
if __name__ == '__main__':
main()
......@@ -20,3 +20,41 @@
inc_drm_uapi = include_directories('drm-uapi')
inc_vulkan = include_directories('vulkan')
if with_gles1
install_headers(
'GLES/egl.h', 'GLES/gl.h', 'GLES/glext.h', 'GLES/glplatform.h',
subdir : 'GLES',
)
endif
if with_gles2
install_headers(
'GLES2/gl2.h', 'GLES2/gl2ext.h', 'GLES2/gl2platform.h',
subdir : 'GLES2',
)
install_headers(
'GLES3/gl3.h', 'GLES3/gl32.h', 'GLES3/gl32.h', 'GLES3/gl3ext.h',
'GLES3/gl3platform.h',
subdir : 'GLES3',
)
endif
if with_gles1 or with_gles2 # or with_egl
install_headers('KHR/khrplatform.h', subdir : 'KHR')
endif
if with_opengl
install_headers(
'GL/gl.h', 'GL/glext.h', 'GL/glcorearb.h', 'GL/gl_mangle.h',
subdir : 'GL',
)
endif
if with_glx
install_headers('GL/glx.h', 'GL/glext.h', 'GL/glx_mangle.h', subdir : 'GL')
endif
if with_osmesa
install_headers('GL/osmesa.h', subdir : 'GL')
endif
......@@ -21,10 +21,68 @@
project('mesa', ['c', 'cpp'], version : '17.3.0-devel', license : 'MIT',
default_options : ['c_std=c99', 'cpp_std=c++11'])
# Arguments for the preprocessor, put these in a separate array from the C and
# C++ (cpp in meson terminology) arguments since they need to be added to the
# default arguments for both C and C++.
pre_args = [
'-D__STDC_CONSTANT_MACROS',
'-D__STDC_FORMAT_MACROS',
'-D__STDC_LIMIT_MACROS',
'-DVERSION="@0@"'.format(meson.project_version()),
'-DPACKAGE_VERSION=VERSION',
'-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"',
]
with_dri3 = true # XXX: need a switch for this
with_vulkan_icd_dir = get_option('vulkan-icd-dir')
with_tests = get_option('build-tests')
with_valgrind = get_option('valgrind')
with_asm = get_option('asm')
# XXX: yeah, do these
with_appledri = false
with_windowsdri = false
with_gles1 = get_option('gles1')
with_gles2 = get_option('gles2')
with_opengl = get_option('opengl')
with_any_opengl = with_opengl or with_gles1 or with_gles2
with_shared_glapi = get_option('shared-glapi')
# TODO: these will need options, but at the moment they just control header
# installs
with_glx = false
with_osmesa = false
# shared-glapi is required if at least two OpenGL APIs are being built
if not with_shared_glapi
if ((with_gles1 and with_gles2) or (with_gles1 and with_opengl)
or (with_gles2 and with_opengl))
error('shared-glapi required for building two or more of OpenGL, OpenGL ES 1.x, OpenGL ES 2.x')
endif
endif
# We require OpenGL for OpenGL ES
if (with_gles1 or with_gles2) and not with_opengl
error('building OpenGL ES without OpenGL is not supported.')
endif
with_dri = false
with_dri_i965 = false
_drivers = get_option('dri-drivers')
if _drivers != ''
_split = _drivers.split(',')
with_dri_i965 = _split.contains('i965')
with_dri = true
endif
if not with_dri
with_gles1 = false
with_gles2 = false
with_opengl = false
with_any_opengl = false
with_shared_glapi = false
endif
# TODO: there are more platforms required for non-vulkan drivers
with_platform_wayland = false
......@@ -63,13 +121,6 @@ if cc.get_id() == 'gcc' and cc.version().version_compare('< 4.4.6')
error('When using GCC, version 4.4.6 or later is required.')
endif
# Arguments for the preprocessor, put these in a separate array from the C and
# C++ (cpp in meson terminology) arguments since they need to be added to the
# default arguments for both C and C++.
pre_args = ['-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS',
'-D__STDC_LIMIT_MACROS',
'-DVERSION="@0@"'.format(meson.project_version())]
# Define DEBUG for debug and debugoptimized builds
if get_option('buildtype').startswith('debug')
pre_args += '-DDEBUG'
......@@ -204,7 +255,39 @@ endif
# TODO: cross-compiling. I don't think this is relavent to meson
# TODO: assembly support. mesa and vc4
# FIXME: enable asm when cross compiler
# This is doable (autotools does it), but it's not of immediate concern
if meson.is_cross_build()
message('Cross compiling, disabling asm')
with_asm = false
endif
with_asm_arch = ''
if with_asm
# TODO: SPARC and PPC
if host_machine.cpu_family() == 'x86'
if ['linux', 'bsd'].contains(host_machine.system()) # FIXME: hurd?
with_asm_arch = 'x86'
pre_args += ['-DUSE_X86_ASM', '-DUSE_MMX_ASM', '-DUSE_3DNOW_ASM',
'-DUSE_SSE_ASM']
endif
elif host_machine.cpu_family() == 'x86_64'
if host_machine.system() == 'linux'
with_asm_arch = 'x86_64'
pre_args += ['-DUSE_X86_64_ASM']
endif
elif host_machine.cpu_family() == 'arm'
if host_machine.system() == 'linux'
with_asm_arch = 'arm'
pre_args += ['-DUSE_ARM_ASM']
endif
elif host_machine.cpu_family() == 'aarch64'
if host_machine.system() == 'linux'
with_asm_arch = 'aarch64'
pre_args += ['-DUSE_AARCH64_ASM']
endif
endif
endif
# Check for standard headers and functions
if cc.has_header_symbol('sys/sysmacros.h', 'major')
......@@ -264,9 +347,9 @@ if cc.has_function('dlopen')
else
dep_dl = cc.find_library('dl')
endif
if not cc.has_function('dladdr', dependencies : dep_dl)
error('dl library doesn\'t have dladdr')
if cc.has_function('dladdr', dependencies : dep_dl)
# This is really only required for megadrivers
pre_args += '-DHAVE_DLADDR'
endif
if cc.has_function('dl_iterate_phdr')
......@@ -336,7 +419,11 @@ endif
# pthread stubs. Lets not and say we didn't
prog_bison = find_program('bison', required : with_any_opengl)
prog_flex = find_program('flex', required : with_any_opengl)
# TODO: selinux
dep_selinux = []
# TODO: llvm-prefix and llvm-shared-libs
......@@ -390,6 +477,7 @@ if with_platform_x11
dependency('xcb-dri2', version : '>= 1.8'),
dependency('xcb-xfixes'),
]
pre_args += '-DHAVE_X11_PLATFORM'
if with_dri3
dep_xcb_dri3 = [
dep_xcb_dri2,
......@@ -453,5 +541,7 @@ endforeach
inc_include = include_directories('include')
pkg = import('pkgconfig')
subdir('include')
subdir('src')
......@@ -20,12 +20,24 @@
option('platforms', type : 'string', value : 'x11,wayland',
description : 'comma separated list of window systems to support. wayland, x11, surfaceless, drm, etc.')
option('dri-drivers', type : 'string', value : 'i965',
description : 'comma separated list of dri drivers to build.')
option('vulkan-drivers', type : 'string', value : 'intel,amd',
description : 'comma separated list of vulkan drivers to build.')
option('shader-cache', type : 'boolean', value : true,
description : 'Build with on-disk shader cache support')
option('vulkan-icd-dir', type : 'string', value : '',
description : 'Location relative to prefix to put vulkan icds on install. Default: $datadir/vulkan/icd.d')
option('shared-glapi', type : 'boolean', value : true,
description : 'Whether to build a shared or static glapi')
option('gles1', type : 'boolean', value : true,
description : 'Build support for OpenGL ES 1.x')
option('gles2', type : 'boolean', value : true,
description : 'Build support for OpenGL ES 2.x and 3.x')
option('opengl', type : 'boolean', value : true,
description : 'Build support for OpenGL (all versions)')
option('asm', type : 'boolean', value : true,
description : 'Build assembly code if possible')
option('valgrind', type : 'boolean', value : true,
description : 'Build with valgrind support if possible')
option('build-tests', type : 'boolean', value : false,
......
# Copyright © 2017 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
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@'],
)
glcpp_lex = custom_target(
'glcpp-lex.c',
input : 'glcpp-lex.l',
output : 'glcpp-lex.c',
command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'],
)
libglcpp = static_library(
'glcpp',
[glcpp_lex, glcpp_parse, files('glcpp.h', 'pp.c')],
link_with : libmesa_util,
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],
build_by_default : false,
)
glcpp = executable(
'glcpp',
'glcpp.c',
dependencies : [dep_m],
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,
)
# TODO: figure out how to make all of these tests work.
......@@ -18,12 +18,231 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# TODO: the rest of this file
subdir('glcpp')
ir_expression_operation_h = custom_target(
'ir_expression_operation.h',
glsl_parser = custom_target(
'glsl_parser',
input : 'glsl_parser.yy',
output : ['glsl_parser.cpp', 'glsl_parser.h'],
command : [prog_bison, '-o', '@OUTPUT0@', '-p', '_mesa_glsl_',
'--defines=@OUTPUT1@', '@INPUT@'],
)
glsl_lexer_cpp = custom_target(
'glsl_lexer_cpp',
input : 'glsl_lexer.ll',
output : 'glsl_lexer.cpp',
command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'],
)
ir_expression_operation_constant_h = custom_target(
'ir_expression_operation_constant.h',
input : 'ir_expression_operation.py',
output : 'ir_expression_operation.h',
command : [prog_python2, '@INPUT@', 'enum'],
output : 'ir_expression_operation_constant.h',
command : [prog_python2, '@INPUT@', 'constant'],
capture : true,
)
ir_expression_operation_strings_h = custom_target(
'ir_expression_operation_strings.h',
input : 'ir_expression_operation.py',
output : 'ir_expression_operation_strings.h',
command : [prog_python2, '@INPUT@', 'strings'],
capture : true,
)
files_libglsl = files(
'ast.h',
'ast_array_index.cpp',
'ast_expr.cpp',
'ast_function.cpp',
'ast_to_hir.cpp',
'ast_type.cpp',
'blob.c',
'blob.h',
'builtin_functions.cpp',
'builtin_functions.h',
'builtin_int64.h',
'builtin_types.cpp',
'builtin_variables.cpp',
'generate_ir.cpp',
'glsl_parser_extras.cpp',
'glsl_parser_extras.h',
'glsl_symbol_table.cpp',
'glsl_symbol_table.h',
'glsl_to_nir.cpp',
'glsl_to_nir.h',
'hir_field_selection.cpp',
'ir_array_refcount.cpp',
'ir_array_refcount.h',
'ir_basic_block.cpp',
'ir_basic_block.h',
'ir_builder.cpp',
'ir_builder.h',
'ir_clone.cpp',
'ir_constant_expression.cpp',
'ir.cpp',
'ir.h',
'ir_equals.cpp',
'ir_expression_flattening.cpp',
'ir_expression_flattening.h',
'ir_function_can_inline.cpp',
'ir_function_detect_recursion.cpp',
'ir_function_inlining.h',
'ir_function.cpp',
'ir_hierarchical_visitor.cpp',
'ir_hierarchical_visitor.h',
'ir_hv_accept.cpp',
'ir_optimization.h',
'ir_print_visitor.cpp',
'ir_print_visitor.h',
'ir_reader.cpp',
'ir_reader.h',
'ir_rvalue_visitor.cpp',
'ir_rvalue_visitor.h',
'ir_set_program_inouts.cpp',
'ir_uniform.h',
'ir_validate.cpp',
'ir_variable_refcount.cpp',
'ir_variable_refcount.h',
'ir_visitor.h',
'linker.cpp',
'linker.h',
'link_atomics.cpp',
'link_functions.cpp',
'link_interface_blocks.cpp',
'link_uniforms.cpp',
'link_uniform_initializers.cpp',
'link_uniform_block_active_visitor.cpp',
'link_uniform_block_active_visitor.h',
'link_uniform_blocks.cpp',
'link_varyings.cpp',
'link_varyings.h',
'list.h',
'loop_analysis.cpp',
'loop_analysis.h',
'loop_unroll.cpp',
'lower_blend_equation_advanced.cpp',
'lower_buffer_access.cpp',
'lower_buffer_access.h',
'lower_const_arrays_to_uniforms.cpp',
'lower_discard.cpp',
'lower_discard_flow.cpp',
'lower_distance.cpp',
'lower_if_to_cond_assign.cpp',
'lower_instructions.cpp',
'lower_int64.cpp',
'lower_jumps.cpp',
'lower_mat_op_to_vec.cpp',
'lower_noise.cpp',
'lower_offset_array.cpp',
'lower_packed_varyings.cpp',
'lower_named_interface_blocks.cpp',
'lower_packing_builtins.cpp',
'lower_subroutine.cpp',
'lower_tess_level.cpp',
'lower_texture_projection.cpp',
'lower_variable_index_to_cond_assign.cpp',
'lower_vec_index_to_cond_assign.cpp',
'lower_vec_index_to_swizzle.cpp',
'lower_vector.cpp',
'lower_vector_derefs.cpp',
'lower_vector_insert.cpp',
'lower_vertex_id.cpp',
'lower_output_reads.cpp',
'lower_shared_reference.cpp',
'lower_ubo_reference.cpp',
'opt_algebraic.cpp',
'opt_array_splitting.cpp',
'opt_conditional_discard.cpp',
'opt_constant_folding.cpp',
'opt_constant_propagation.cpp',
'opt_constant_variable.cpp',
'opt_copy_propagation.cpp',
'opt_copy_propagation_elements.cpp',
'opt_dead_builtin_variables.cpp',
'opt_dead_builtin_varyings.cpp',
'opt_dead_code.cpp',
'opt_dead_code_local.cpp',
'opt_dead_functions.cpp',
'opt_flatten_nested_if_blocks.cpp',
'opt_flip_matrices.cpp',
'opt_function_inlining.cpp',
'opt_if_simplification.cpp',
'opt_minmax.cpp',
'opt_noop_swizzle.cpp',
'opt_rebalance_tree.cpp',
'opt_redundant_jumps.cpp',
'opt_structure_splitting.cpp',
'opt_swizzle_swizzle.cpp',
'opt_tree_grafting.cpp',
'opt_vectorize.cpp',
'program.h',
'propagate_invariance.cpp',
's_expression.cpp',
's_expression.h',
'string_to_uint_map.cpp',
'string_to_uint_map.h',
'shader_cache.cpp',
'shader_cache.h',
)
files_libglsl_standalone = files(
'ir_builder_print_visitor.cpp',
'ir_builder_print_visitor.h',
'opt_add_neg_to_sub.h',
'standalone_scaffolding.cpp',
'standalone_scaffolding.h',
'standalone.cpp',
'standalone.h',
)
libglsl = static_library(
'glsl',
[files_libglsl, glsl_parser, glsl_lexer_cpp, ir_expression_operation_h,
ir_expression_operation_strings_h, ir_expression_operation_constant_h],
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
link_with : [libnir, libglcpp],
include_directories : [inc_common, inc_nir],
dependencies : [dep_valgrind],
build_by_default : false,
)
libglsl_standalone = static_library(
'glsl_standalone',
[files_libglsl_standalone, ir_expression_operation_h],
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
include_directories : [inc_common],
link_with : [libglsl, libglsl_util, libmesa_util],
dependencies : [dep_thread],
build_by_default : false,
)
glsl_compiler = executable(
'glsl_compiler',
'main.cpp',
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
dependencies : [dep_clock],
include_directories : [inc_common],
link_with : [libglsl_standalone],
build_by_default : false,
)
glsl_test = executable(
'glsl_test',
['test.cpp', 'test_optpass.cpp', 'test_optpass.h',
ir_expression_operation_h],
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
include_directories : [inc_common],
dependencies : [dep_clock, dep_thread],
link_with : [libglsl, libglsl_standalone, libglsl_util],
build_by_default : false,
)
if with_tests
subdir('tests')
endif
# Copyright © 2017 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
glsl_blob_test = executable(
'blob_test',
'blob_test.c',
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
include_directories : [inc_common, inc_glsl],
link_with : [libglsl],
)
glsl_cache_test = executable(
'cache_test',
'cache_test.c',
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
include_directories : [inc_common, inc_glsl],
link_with : [libglsl],
dependencies : [dep_clock, dep_thread],
)
glsl_general_ir_test = executable(
'general_ir_test',
['array_refcount_test.cpp', 'builtin_variable_test.cpp',
'invalidate_locations_test.cpp', 'general_ir_test.cpp',
'lower_int64_test.cpp', 'opt_add_neg_to_sub_test.cpp', 'varyings_test.cpp',
ir_expression_operation_h],
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
include_directories : [inc_common, inc_glsl],
link_with : [libglsl, libglsl_standalone, libglsl_util],
dependencies : [dep_clock, dep_thread, idep_gtest],
)
glsl_uniform_initializer_test = executable(
'uniform_initializer_test',
['copy_constant_to_storage_tests.cpp', 'set_uniform_initializer_tests.cpp',
'uniform_initializer_utils.cpp', 'uniform_initializer_utils.h',
ir_expression_operation_h],
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
include_directories : [inc_common, inc_glsl],
link_with : [libglsl, libglsl_util],
dependencies : [dep_thread, idep_gtest],
)
glsl_sampler_types_test = executable(
'sampler_types_test',
['sampler_types_test.cpp', ir_expression_operation_h],
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
include_directories : [inc_common, inc_glsl],
link_with : [libglsl, libglsl_util],
dependencies : [dep_thread, idep_gtest],
)
test('blob_test', glsl_blob_test)
test('cache_test', glsl_cache_test)
test('general_ir_test', glsl_general_ir_test)
test('uniform_initializer_test', glsl_uniform_initializer_test)
test('sampler_types_test', glsl_sampler_types_test)
# TODO: figure out how to get the shell based tests to work?
......@@ -22,8 +22,6 @@ inc_compiler = include_directories('.')
inc_nir = include_directories('nir')
inc_glsl = include_directories('glsl')
subdir('glsl')
files_libcompiler = files(
'builtin_type_macros.h',
'glsl_types.cpp',
......@@ -35,6 +33,14 @@ files_libcompiler = files(
'shader_info.h',
)
ir_expression_operation_h = custom_target(
'ir_expression_operation.h',
input : 'glsl/ir_expression_operation.py',
output : 'ir_expression_operation.h',
command : [prog_python2, '@INPUT@', 'enum'],
capture : true,
)
libcompiler = static_library(
'compiler',
[files_libcompiler, ir_expression_operation_h],
......@@ -55,3 +61,5 @@ spirv2nir = executable(
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
build_by_default : false,
)
subdir('glsl')
#define MESA_GIT_SHA1 "git-@VCS_TAG@"
# Copyright © 2017 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
es1_glapi_mapi_tmp_h = custom_target(
'es1_glapi_mapi_tmp.h',
input : ['../mapi_abi.py', gl_and_es_api_files],
output : 'glapi_mapi_tmp.h',
command : [prog_python2, '@INPUT0@', '--printer', 'es1api', '@INPUT1@'],
depend_files : api_xml_files,
capture : true,
)
libglesv1_cm = shared_library(
'GLESv1_CM',
['../entry.c', es1_glapi_mapi_tmp_h],
c_args : [c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
'-DMAPI_ABI_HEADER="@0@"'.format(es1_glapi_mapi_tmp_h.full_path())],
link_args : [ld_args_gc_sections],
include_directories : [inc_src, inc_include, inc_mapi],
link_with : libglapi,
dependencies : [dep_thread, dep_libdrm, dep_m, dep_dl],
version : '1.1',
install : true,
)
pkg.generate(
name : 'glesv1_cm',
filebase : 'glesv1_cm',
description : 'Mesa OpenGL ES 1.1 CM library',
version : meson.project_version(),
libraries : libglesv1_cm,
libraries_private : '-lm -ldl -lpthread -pthread',
)
if with_tests
test('es1-ABI-check', find_program('ABI-check'))
endif
# Copyright © 2017 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
es2_glapi_mapi_tmp_h = custom_target(
'es2_glapi_mapi_tmp.h',
input : ['../mapi_abi.py', gl_and_es_api_files],
output : 'glapi_mapi_tmp.h',
command : [prog_python2, '@INPUT0@', '--printer', 'es2api', '@INPUT1@'],
depend_files : api_xml_files,
capture : true,