Merge branch 'meson' into 'master'
New meson build system See merge request glvnd/libglvnd!199
This commit is contained in:
commit
a1350eef8a
|
@ -7,3 +7,7 @@ indent_style = space
|
|||
[{Makefile.am,*.mk}]
|
||||
indent_size = 8
|
||||
indent_style = tab
|
||||
|
||||
[{meson.build,meson_options.txt}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# vim: set expandtab shiftwidth=2 tabstop=2 textwidth=0:
|
||||
|
||||
variables:
|
||||
UBUNTU_TAG: "2019-12-03-01"
|
||||
UBUNTU_TAG: "2019-12-05-01"
|
||||
UBUNTU_VERSION: "18.04"
|
||||
UBUNTU_CONTAINER_IMAGE: "$CI_REGISTRY_IMAGE/ubuntu/$UBUNTU_VERSION:$UBUNTU_TAG"
|
||||
UBUNTU_EXEC: "bash .gitlab-ci/ubuntu_install.sh"
|
||||
|
@ -38,8 +38,6 @@ build-distcheck:
|
|||
.build-check:
|
||||
stage: build
|
||||
image: $UBUNTU_CONTAINER_IMAGE
|
||||
script:
|
||||
- bash .gitlab-ci/run_build.sh
|
||||
only:
|
||||
changes:
|
||||
- src/GLdispatch/vnd-glapi/**
|
||||
|
@ -48,33 +46,78 @@ build-distcheck:
|
|||
- .gitlab-ci.yml
|
||||
- .gitlab-ci/**
|
||||
|
||||
build-i386:
|
||||
.build-check-at:
|
||||
extends:
|
||||
- .build-check
|
||||
script:
|
||||
- bash .gitlab-ci/run_build.sh
|
||||
|
||||
.build-check-meson:
|
||||
extends:
|
||||
- .build-check
|
||||
script:
|
||||
- bash .gitlab-ci/run_meson.sh
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
- build/meson-logs/*.txt
|
||||
|
||||
build-i386:
|
||||
extends:
|
||||
- .build-check-at
|
||||
variables:
|
||||
CONFIGURE_OPTIONS: --build=i686-pc-linux-gnu CFLAGS=-m32
|
||||
|
||||
build-i386-meson:
|
||||
extends:
|
||||
- .build-check-meson
|
||||
variables:
|
||||
CONFIGURE_OPTIONS: --cross-file .gitlab-ci/i686-linux-gnu
|
||||
|
||||
build-x86-64-tsd:
|
||||
extends:
|
||||
- .build-check
|
||||
- .build-check-at
|
||||
variables:
|
||||
CONFIGURE_OPTIONS: --disable-tls
|
||||
|
||||
build-x86_64-tsd-meson:
|
||||
extends:
|
||||
- .build-check-meson
|
||||
variables:
|
||||
CONFIGURE_OPTIONS: -Dtls=disabled
|
||||
|
||||
build-i386-tsd:
|
||||
extends:
|
||||
- .build-check
|
||||
- .build-check-at
|
||||
variables:
|
||||
CONFIGURE_OPTIONS: --build=i686-pc-linux-gnu CFLAGS=-m32 --disable-tls
|
||||
|
||||
build-i386-tsd-meson:
|
||||
extends:
|
||||
- .build-check-meson
|
||||
variables:
|
||||
CONFIGURE_OPTIONS: -Dtls=disabled --cross-file .gitlab-ci/i686-linux-gnu
|
||||
|
||||
build-pure-c-tls:
|
||||
extends:
|
||||
- .build-check
|
||||
- .build-check-at
|
||||
variables:
|
||||
CONFIGURE_OPTIONS: --disable-asm
|
||||
|
||||
build-pure-c-tls-meson:
|
||||
extends:
|
||||
- .build-check-meson
|
||||
variables:
|
||||
CONFIGURE_OPTIONS: -Dasm=disabled
|
||||
|
||||
build-pure-c-tsd:
|
||||
extends:
|
||||
- .build-check
|
||||
- .build-check-at
|
||||
variables:
|
||||
CONFIGURE_OPTIONS: --disable-asm --disable-tls
|
||||
|
||||
build-pure-c-tld-meson:
|
||||
extends:
|
||||
- .build-check-meson
|
||||
variables:
|
||||
CONFIGURE_OPTIONS: -Dasm=disabled -Dtls=disabled
|
||||
|
|
19
.gitlab-ci/i686-linux-gnu
Normal file
19
.gitlab-ci/i686-linux-gnu
Normal file
|
@ -0,0 +1,19 @@
|
|||
[binaries]
|
||||
c = '/usr/bin/gcc'
|
||||
cpp = '/usr/bin/g++'
|
||||
ar = '/usr/bin/ar'
|
||||
strip = '/usr/bin/strip'
|
||||
pkgconfig = '/usr/bin/i686-linux-gnu-pkg-config'
|
||||
|
||||
[properties]
|
||||
c_args = ['-m32']
|
||||
c_link_args = ['-m32']
|
||||
cpp_args = ['-m32']
|
||||
cpp_link_args = ['-m32']
|
||||
needs_exe_wrapper = false
|
||||
|
||||
[host_machine]
|
||||
system = 'linux'
|
||||
cpu_family = 'x86'
|
||||
cpu = 'i686'
|
||||
endian = 'little'
|
|
@ -16,5 +16,27 @@ DISPLAY=:99 make distcheck V=1 VERBOSE=1
|
|||
RESULT=$?
|
||||
set -e
|
||||
|
||||
# If make distcheck failed don't even bother with the meson check, the tarball
|
||||
# may be invalid and it's just a waste
|
||||
if [ $RESULT -ne 0 ]; then
|
||||
kill %Xvfb
|
||||
exit $RESULT
|
||||
fi
|
||||
|
||||
# Also check that the meson build works from the dist tarball
|
||||
|
||||
# We don't have a good way to know what the name of the archive will be (since
|
||||
# it has the version in it). Therefore, write the tarball to a place we know
|
||||
# the name of and work from there.
|
||||
mkdir libglvnd
|
||||
tar -xf libglvnd-*.tar.gz -C libglvnd --strip-components 1
|
||||
pushd libglvnd
|
||||
meson builddir --auto-features=enabled
|
||||
set +e
|
||||
DISPLAY=:99 ninja -C builddir test
|
||||
RESULT=$?
|
||||
set -e
|
||||
popd
|
||||
|
||||
kill %Xvfb
|
||||
exit $RESULT
|
||||
|
|
22
.gitlab-ci/run_meson.sh
Normal file
22
.gitlab-ci/run_meson.sh
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
|
||||
# Running a unity build (sometimes called a jumbo build) is both a useful thing
|
||||
# to test and reduces compile time.
|
||||
#
|
||||
# Enable all auto-features to ensure that we're proprely testing all optional
|
||||
# dependencies.
|
||||
meson build --unity=on --auto-features=enabled $CONFIGURE_OPTIONS
|
||||
ninja -C build
|
||||
|
||||
Xvfb :99 &
|
||||
|
||||
set +e
|
||||
DISPLAY=:99 ninja -C build test
|
||||
RESULT=$?
|
||||
set -e
|
||||
|
||||
kill %Xvfb
|
||||
exit $RESULT
|
|
@ -11,14 +11,21 @@ apt-get update
|
|||
apt-get install -y --no-remove --no-install-recommends \
|
||||
autoconf \
|
||||
automake \
|
||||
pkg-config \
|
||||
libtool \
|
||||
libxext-dev \
|
||||
libx11-dev \
|
||||
x11proto-gl-dev \
|
||||
python3 \
|
||||
xvfb \
|
||||
gcc-multilib \
|
||||
libtool \
|
||||
libx11-dev \
|
||||
libx11-dev:i386 \
|
||||
libxext-dev \
|
||||
libxext-dev:i386 \
|
||||
libx11-dev:i386
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
pkg-config-i686-linux-gnu \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
x11proto-gl-dev \
|
||||
xvfb
|
||||
|
||||
# We need a version of meson later than the 0.45 in ubuntu 18.04
|
||||
pip3 install meson
|
|
@ -3,7 +3,9 @@ ACLOCAL_AMFLAGS = -I m4
|
|||
EXTRA_DIST = \
|
||||
autogen.sh \
|
||||
README.md \
|
||||
bin/symbols-check.py
|
||||
bin/symbols-check.py \
|
||||
meson.build \
|
||||
meson_options.txt
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libglvnd.pc
|
||||
|
|
10
README.md
10
README.md
|
@ -24,6 +24,16 @@ On Debian and derivatives, run:
|
|||
|
||||
Run `./autogen.sh`, then run `./configure` and `make`.
|
||||
|
||||
Alternatively you can use meson and ninja, which is much faster but should be
|
||||
otherwise the same (You will need packages from above too):
|
||||
|
||||
sudo apt-get install ninja-build meson
|
||||
meson builddir
|
||||
ninja -C builddir
|
||||
|
||||
Meson 0.48.0 is currently required, if your distro doesn't have meson 0.48 in
|
||||
the repos you can try the methods suggested
|
||||
[here](https://mesonbuild.com/Getting-meson.html).
|
||||
|
||||
Code overview
|
||||
-------------
|
||||
|
|
|
@ -76,3 +76,4 @@ else
|
|||
noinst_HEADERS += $(EGL_HEADER_FILES)
|
||||
endif
|
||||
|
||||
EXTRA_DIST = meson.build
|
96
include/meson.build
Normal file
96
include/meson.build
Normal file
|
@ -0,0 +1,96 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
inc_include = include_directories('.')
|
||||
|
||||
install_headers(
|
||||
'glvnd/GLdispatchABI.h',
|
||||
'glvnd/libglxabi.h',
|
||||
'glvnd/libeglabi.h',
|
||||
subdir : 'glvnd'
|
||||
)
|
||||
|
||||
_headers = get_option('headers')
|
||||
|
||||
if _headers
|
||||
install_headers(
|
||||
'GL/gl.h',
|
||||
'GL/glcorearb.h',
|
||||
'GL/glext.h',
|
||||
subdir : 'GL',
|
||||
)
|
||||
|
||||
install_headers(
|
||||
'KHR/khrplatform.h',
|
||||
subdir : 'KHR',
|
||||
)
|
||||
endif
|
||||
|
||||
if with_glx and _headers
|
||||
install_headers(
|
||||
'GL/glx.h',
|
||||
'GL/glxext.h',
|
||||
subdir : 'GL',
|
||||
)
|
||||
endif
|
||||
|
||||
if get_option('gles1') and _headers
|
||||
install_headers(
|
||||
'GLES/egl.h',
|
||||
'GLES/gl.h',
|
||||
'GLES/glext.h',
|
||||
'GLES/glplatform.h',
|
||||
subdir : 'GLES'
|
||||
)
|
||||
endif
|
||||
|
||||
if get_option('gles2') and _headers
|
||||
install_headers(
|
||||
'GLES2/gl2ext.h',
|
||||
'GLES2/gl2.h',
|
||||
'GLES2/gl2platform.h',
|
||||
subdir : 'GLES2',
|
||||
)
|
||||
install_headers(
|
||||
'GLES3/gl31.h',
|
||||
'GLES3/gl32.h',
|
||||
'GLES3/gl3.h',
|
||||
'GLES3/gl3ext.h',
|
||||
'GLES3/gl3platform.h',
|
||||
subdir : 'GLES3',
|
||||
)
|
||||
endif
|
||||
|
||||
if get_option('egl') and _headers
|
||||
install_headers(
|
||||
'EGL/egl.h',
|
||||
'EGL/eglext.h',
|
||||
'EGL/eglplatform.h',
|
||||
subdir : 'EGL',
|
||||
)
|
||||
endif
|
||||
|
191
meson.build
Normal file
191
meson.build
Normal file
|
@ -0,0 +1,191 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
project(
|
||||
'glvnd',
|
||||
'c',
|
||||
version : '1.3.0-devel',
|
||||
meson_version : '>= 0.48',
|
||||
default_options : ['c_std=gnu99']
|
||||
)
|
||||
|
||||
dep_null = dependency('', required : false)
|
||||
cc = meson.get_compiler('c')
|
||||
prog_py = import('python').find_installation()
|
||||
files_symbols_check = files('bin/symbols-check.py')
|
||||
prog_nm = find_program('nm')
|
||||
|
||||
with_asm = get_option('asm')
|
||||
use_asm = false
|
||||
if not with_asm.disabled()
|
||||
use_asm = true
|
||||
if (host_machine.cpu_family() == 'x86' and
|
||||
['gnu', 'freebsd', 'dragonfly', 'linux',
|
||||
'netbsd'].contains(host_machine.system()))
|
||||
add_project_arguments(
|
||||
'-DUSE_X86_ASM',
|
||||
'-DUSE_MMX_ASM',
|
||||
'-DUSE_3DNOW_ASM',
|
||||
'-DUSE_SSE_ASM',
|
||||
language : 'c',
|
||||
)
|
||||
elif (host_machine.cpu_family() == 'x86_64' and
|
||||
['freebsd', 'dragonfly', 'linux',
|
||||
'netbsd'].contains(host_machine.system()))
|
||||
add_project_arguments('-DUSE_X86_64_ASM', language : 'c')
|
||||
elif host_machine.cpu_family() == 'arm'
|
||||
add_project_arguments('-DUSE_ARMV7_ASM', language : 'c')
|
||||
elif host_machine.cpu_family() == 'aarch64'
|
||||
add_project_arguments('-DUSE_AARCH64_ASM', language : 'c')
|
||||
elif host_machine.cpu_family() == 'ppc' and host_machine.endian() == 'little'
|
||||
add_project_arguments('-DUSE_PPC64LE_ASM', language : 'c')
|
||||
elif with_asm.enabled()
|
||||
error('No ASM available for @0@ (@1@ endian)'.format(host_machine.system(), host_machine.endian()))
|
||||
else
|
||||
use_asm = false
|
||||
endif
|
||||
endif
|
||||
|
||||
if use_asm
|
||||
add_project_arguments('-DUSE_DISPATCH_ASM', language : 'c')
|
||||
endif
|
||||
|
||||
dep_dl = cc.find_library('dl', required : false)
|
||||
dep_m = cc.find_library('m', required : false)
|
||||
dep_threads = dependency('threads')
|
||||
dep_x11 = dependency('x11', required : get_option('x11'))
|
||||
dep_x11_headers = dep_x11.partial_dependency(compile_args : true, includes : true)
|
||||
if dep_x11.found()
|
||||
add_project_arguments('-DUSE_X11', language : ['c'])
|
||||
endif
|
||||
|
||||
dep_xext = dep_null
|
||||
dep_glproto = dep_null
|
||||
with_glx = false
|
||||
if get_option('glx').enabled() and not dep_x11.found()
|
||||
error('Cannot build GLX support without X11.')
|
||||
elif not get_option('glx').disabled() and dep_x11.found()
|
||||
dep_xext = dependency('xext', required : get_option('glx'))
|
||||
dep_glproto = dependency('glproto', required : get_option('glx'))
|
||||
with_glx = true
|
||||
endif
|
||||
dep_glx = [dep_xext, dep_glproto]
|
||||
|
||||
if cc.compiles('typeof(int *);', name : 'typeof')
|
||||
add_project_arguments('-DHAVE_TYPEOF', language : ['c'])
|
||||
endif
|
||||
|
||||
with_tls = get_option('tls')
|
||||
have_tls = false
|
||||
if not with_tls.disabled()
|
||||
have_tls = cc.compiles(
|
||||
'__thread int foo __attribute__((tls_model("initial-exec")));',
|
||||
name : 'initial-exec TLS',
|
||||
)
|
||||
endif
|
||||
|
||||
if have_tls
|
||||
add_project_arguments('-DGLDISPATCH_USE_TLS', language : ['c'])
|
||||
endif
|
||||
|
||||
gl_dispatch_type = 'pure_c'
|
||||
if use_asm
|
||||
if host_machine.cpu_family().startswith('x86')
|
||||
gl_dispatch_type = '@0@_@1@'.format(
|
||||
host_machine.cpu_family(),
|
||||
have_tls ? 'tls' : 'tsd',
|
||||
)
|
||||
elif host_machine.cpu_family() == 'arm'
|
||||
gl_dispatch_type = 'armv7_tsd'
|
||||
elif host_machine.cpu_family() == 'aarch64'
|
||||
gl_dispatch_type = 'aarch64_tsd'
|
||||
elif host_machine.cpu_family() == 'ppc64' and host_machine.endian() == 'little'
|
||||
gl_dispatch_type = 'ppc64le_@1@'.format(have_tls ? 'tls' : 'tsd')
|
||||
endif
|
||||
endif
|
||||
add_project_arguments('-DGLDISPATCH_TYPE_@0@'.format(gl_dispatch_type.to_upper()), language : ['c'])
|
||||
|
||||
if cc.has_function_attribute('constructor')
|
||||
add_project_arguments('-DUSE_ATTRIBUTE_CONSTRUCTOR', language : ['c'])
|
||||
endif
|
||||
|
||||
if cc.compiles('''
|
||||
#include <pthread.h>
|
||||
void foo(void)
|
||||
{
|
||||
pthread_rwlock_t lock;
|
||||
pthread_rwlock_init(&lock, NULL);
|
||||
}''',
|
||||
name : 'pthread rwlock')
|
||||
add_project_arguments('-DHAVE_PTHREAD_RWLOCK', language : ['c'])
|
||||
endif
|
||||
|
||||
if cc.compiles('''
|
||||
int foo(int volatile *val, int oldVal, int newVal)
|
||||
{
|
||||
return __sync_add_and_fetch(val, 1);
|
||||
return __sync_lock_test_and_set(val, newVal);
|
||||
return __sync_val_compare_and_swap(val, oldVal, newVal);
|
||||
}''',
|
||||
name : 'sync intrinsics')
|
||||
add_project_arguments('-DHAVE_SYNC_INTRINSICS', language : ['c'])
|
||||
endif
|
||||
|
||||
if cc.has_function('mincore')
|
||||
add_project_arguments('-DHAVE_MINCORE', language : ['c'])
|
||||
endif
|
||||
|
||||
if cc.has_header_symbol('dlfcn.h', 'RTLD_NOLOAD')
|
||||
add_project_arguments('-DHAVE_RTLD_NOLOAD', language : ['c'])
|
||||
endif
|
||||
|
||||
if cc.has_member('struct dirent', 'd_type', prefix : '#include <dirent.h>')
|
||||
add_project_arguments('-DHAVE_DIRENT_DTYPE', language : ['c'])
|
||||
endif
|
||||
|
||||
_p = get_option('dispatch-page-size')
|
||||
if _p != 0
|
||||
add_project_arguments('-DGLDISPATCH_PAGE_SIZE=' + _p, language : ['c'])
|
||||
endif
|
||||
|
||||
# Set EGL_NO_X11 unconditionally, Libglvnd doesn't make any assumptions about
|
||||
# native display or drawable types, so we don't need X11-specific typedefs for
|
||||
# them
|
||||
add_project_arguments('-DEGL_NO_X11', language : ['c'])
|
||||
|
||||
pkg = import('pkgconfig')
|
||||
|
||||
subdir('include')
|
||||
subdir('src')
|
||||
subdir('tests')
|
||||
|
||||
pkg.generate(
|
||||
name : 'libglvnd',
|
||||
description : 'Vendor-neutral OpenGL dispatch library vendor interface',
|
||||
version : meson.project_version(),
|
||||
)
|
||||
|
77
meson_options.txt
Normal file
77
meson_options.txt
Normal file
|
@ -0,0 +1,77 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
option(
|
||||
'asm',
|
||||
type : 'feature',
|
||||
description : 'Use ASM when compiling.'
|
||||
)
|
||||
option(
|
||||
'x11',
|
||||
type : 'feature',
|
||||
description : 'Support the X11 window system.'
|
||||
)
|
||||
option(
|
||||
'egl',
|
||||
type : 'boolean',
|
||||
value : true,
|
||||
description : 'Support the EGL platform.'
|
||||
)
|
||||
option(
|
||||
'glx',
|
||||
type : 'feature',
|
||||
description : 'Support the GLX platform.'
|
||||
)
|
||||
option(
|
||||
'gles1',
|
||||
type : 'boolean',
|
||||
value : true,
|
||||
description : 'Support OpenGL ES 1.x.'
|
||||
)
|
||||
option(
|
||||
'gles2',
|
||||
type : 'boolean',
|
||||
value : true,
|
||||
description : 'Support OpenGL ES 2.x and 3.x.'
|
||||
)
|
||||
option(
|
||||
'tls',
|
||||
type : 'feature',
|
||||
description : 'Use Thread Local Storage.'
|
||||
)
|
||||
option(
|
||||
'dispatch-page-size',
|
||||
type : 'integer',
|
||||
value : 0,
|
||||
description : 'Page size to align static dispatch stubs.'
|
||||
)
|
||||
option(
|
||||
'headers',
|
||||
type : 'boolean',
|
||||
value : true,
|
||||
description : 'Install headers for enabled APIs.'
|
||||
)
|
|
@ -119,7 +119,9 @@ TESTS = egl-symbol-check.sh
|
|||
|
||||
EXTRA_DIST = \
|
||||
egl-symbol-check.sh \
|
||||
egl.symbols
|
||||
egl.symbols \
|
||||
meson.build
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = egl.pc
|
||||
|
||||
|
|
78
src/EGL/meson.build
Normal file
78
src/EGL/meson.build
Normal file
|
@ -0,0 +1,78 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
libegl_dispatch_stubs = static_library(
|
||||
'egl_dispatch_stubs',
|
||||
['egldispatchstubs.c', g_egldispatchstubs_c, g_egldispatchstubs_h],
|
||||
include_directories : inc_include,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
libEGL = shared_library(
|
||||
'EGL',
|
||||
[
|
||||
'libegl.c',
|
||||
'libeglcurrent.c',
|
||||
'libeglmapping.c',
|
||||
'libeglvendor.c',
|
||||
'libeglerror.c',
|
||||
],
|
||||
c_args : [
|
||||
'-DDEFAULT_EGL_VENDOR_CONFIG_DIRS="@0@/glvnd/egl_vendor.d:@1@/glvnd/egl_vendor.d"'.format(
|
||||
join_paths(get_option('prefix'), get_option('sysconfdir')),
|
||||
join_paths(get_option('prefix'), get_option('datadir'))),
|
||||
],
|
||||
include_directories : inc_include,
|
||||
link_args : '-Wl,-Bsymbolic',
|
||||
link_with : libegl_dispatch_stubs,
|
||||
dependencies : [
|
||||
dep_threads, dep_dl, dep_m, dep_x11_headers, idep_trace, idep_glvnd_pthread,
|
||||
idep_utils_misc, idep_cjson, idep_winsys_dispatch, idep_gldispatch,
|
||||
],
|
||||
version : '1.1.0',
|
||||
install : true,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
libEGL,
|
||||
filebase : 'egl',
|
||||
description : 'EGL library and headers',
|
||||
version : '1.5',
|
||||
)
|
||||
|
||||
test(
|
||||
'EGL symbols check',
|
||||
prog_py,
|
||||
args : [
|
||||
files_symbols_check,
|
||||
'--nm', prog_nm.path(),
|
||||
'--lib', libEGL,
|
||||
'--symbols-file', files('egl.symbols'),
|
||||
],
|
||||
suite : ['egl', 'symbols'],
|
||||
)
|
|
@ -83,4 +83,5 @@ pkgconfig_DATA = gl.pc
|
|||
|
||||
EXTRA_DIST = \
|
||||
gl-symbol-check.sh \
|
||||
gl.symbols
|
||||
gl.symbols \
|
||||
meson.build
|
||||
|
|
59
src/GL/meson.build
Normal file
59
src/GL/meson.build
Normal file
|
@ -0,0 +1,59 @@
|
|||
|
||||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
libGL = shared_library(
|
||||
'GL',
|
||||
['libgl.c', g_libglglxwrapper_c],
|
||||
include_directories : [inc_include],
|
||||
link_args : '-Wl,-Bsymbolic',
|
||||
dependencies : [
|
||||
dep_dl, idep_gldispatch, idep_glapi_gl, idep_glx, idep_utils_misc,
|
||||
],
|
||||
version : '1.7.0',
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
install : true,
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
libGL,
|
||||
filebase : 'gl',
|
||||
description : 'Legacy OpenGL and GLX library and headers.',
|
||||
version : '1.2',
|
||||
)
|
||||
|
||||
test(
|
||||
'GL symbols check',
|
||||
prog_py,
|
||||
args : [
|
||||
files_symbols_check,
|
||||
'--nm', prog_nm.path(),
|
||||
'--lib', libGL,
|
||||
'--symbols-file', files('gl.symbols'),
|
||||
],
|
||||
suite : ['symbols'],
|
||||
)
|
|
@ -50,4 +50,5 @@ TESTS = glesv1-symbol-check.sh
|
|||
|
||||
EXTRA_DIST = \
|
||||
glesv1-symbol-check.sh \
|
||||
glesv1.symbols
|
||||
glesv1.symbols \
|
||||
meson.build
|
||||
|
|
56
src/GLESv1/meson.build
Normal file
56
src/GLESv1/meson.build
Normal file
|
@ -0,0 +1,56 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
libGLESv1 = shared_library(
|
||||
'GLESv1_CM',
|
||||
link_whole : libopengl_main,
|
||||
dependencies : [
|
||||
idep_gldispatch, idep_utils_misc, idep_glapi_glesv1,
|
||||
],
|
||||
version : '1.2.0',
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
install : true,
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
libGLESv1,
|
||||
filebase : 'glesv1_cm',
|
||||
description : 'OpenGL ES-CM v1 library and headers.',
|
||||
version : '1.0',
|
||||
)
|
||||
|
||||
test(
|
||||
'GLESv1 symbols check',
|
||||
prog_py,
|
||||
args : [
|
||||
files_symbols_check,
|
||||
'--nm', prog_nm.path(),
|
||||
'--lib', libGLESv1,
|
||||
'--symbols-file', files('glesv1.symbols'),
|
||||
],
|
||||
suite : ['symbols'],
|
||||
)
|
|
@ -50,4 +50,5 @@ TESTS = glesv2-symbol-check.sh
|
|||
|
||||
EXTRA_DIST = \
|
||||
glesv2-symbol-check.sh \
|
||||
glesv2.symbols
|
||||
glesv2.symbols \
|
||||
meson.build
|
||||
|
|
57
src/GLESv2/meson.build
Normal file
57
src/GLESv2/meson.build
Normal file
|
@ -0,0 +1,57 @@
|
|||
|
||||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
libGLESv2 = shared_library(
|
||||
'GLESv2',
|
||||
link_whole : libopengl_main,
|
||||
dependencies : [
|
||||
idep_gldispatch, idep_utils_misc, idep_glapi_glesv2,
|
||||
],
|
||||
version : '2.1.0',
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
install : true,
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
libGLESv2,
|
||||
filebase : 'glesv2',
|
||||
description : 'OpenGL ES v2/v3 library and headers.',
|
||||
version : '3.2',
|
||||
)
|
||||
|
||||
test(
|
||||
'GLESv2 symbols check',
|
||||
prog_py,
|
||||
args : [
|
||||
files_symbols_check,
|
||||
'--nm', prog_nm.path(),
|
||||
'--lib', libGLESv2,
|
||||
'--symbols-file', files('glesv2.symbols'),
|
||||
],
|
||||
suite : ['symbols'],
|
||||
)
|
|
@ -93,4 +93,5 @@ TESTS = glx-symbol-check.sh
|
|||
|
||||
EXTRA_DIST += \
|
||||
glx-symbol-check.sh \
|
||||
glx.symbols
|
||||
glx.symbols \
|
||||
meson.build
|
||||
|
|
81
src/GLX/meson.build
Normal file
81
src/GLX/meson.build
Normal file
|
@ -0,0 +1,81 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
g_glx_dispatch_stub_list_h = custom_target(
|
||||
'g_glx_dispatch_stub_list.h',
|
||||
input : 'gen_glx_stubs.py',
|
||||
output : 'g_glx_dispatch_stub_list.h',
|
||||
command : [prog_py, '@INPUT@'],
|
||||
capture : true,
|
||||
)
|
||||
|
||||
libGLX = shared_library(
|
||||
'GLX',
|
||||
[
|
||||
'libglx.c',
|
||||
'libglxmapping.c',
|
||||
'libglxproto.c',
|
||||
'glvnd_genentry.c',
|
||||
g_glx_dispatch_stub_list_h,
|
||||
],
|
||||
include_directories : [inc_include],
|
||||
link_args : '-Wl,-Bsymbolic',
|
||||
dependencies : [
|
||||
dep_dl, dep_x11, dep_glx, idep_gldispatch, idep_trace,
|
||||
idep_glvnd_pthread, idep_utils_misc,
|
||||
idep_app_error_check, idep_winsys_dispatch,
|
||||
],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
install : true,
|
||||
version : '0.0.0',
|
||||
)
|
||||
|
||||
inc_glx = include_directories('.')
|
||||
|
||||
idep_glx = declare_dependency(
|
||||
link_with : libGLX,
|
||||
include_directories : inc_glx,
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
libGLX,
|
||||
filebase : 'glx',
|
||||
description : 'GLX library and headers.',
|
||||
version : '1.4',
|
||||
)
|
||||
|
||||
test(
|
||||
'GLX symbols check',
|
||||
prog_py,
|
||||
args : [
|
||||
files_symbols_check,
|
||||
'--nm', prog_nm.path(),
|
||||
'--lib', libGLX,
|
||||
'--symbols-file', files('glx.symbols'),
|
||||
],
|
||||
suite : ['glx', 'symbols'],
|
||||
)
|
|
@ -56,4 +56,7 @@ libGLdispatch_la_LIBADD += ../util/libglvnd_pthread.la
|
|||
libGLdispatch_la_LIBADD += ../util/libapp_error_check.la
|
||||
libGLdispatch_la_LIBADD += @LIB_DL@
|
||||
|
||||
EXTRA_DIST = export_list_tls.ver export_list_tsd.ver
|
||||
EXTRA_DIST = \
|
||||
export_list_tls.ver \
|
||||
export_list_tsd.ver \
|
||||
meson.build
|
||||
|
|
58
src/GLdispatch/meson.build
Normal file
58
src/GLdispatch/meson.build
Normal file
|
@ -0,0 +1,58 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
subdir('vnd-glapi')
|
||||
|
||||
if have_tls
|
||||
_ver_script = 'export_list_tls.ver'
|
||||
else
|
||||
_ver_script = 'export_list_tsd.ver'
|
||||
endif
|
||||
_ver_script = join_paths(meson.current_source_dir(), _ver_script)
|
||||
|
||||
libgldispatch = shared_library(
|
||||
'GLdispatch',
|
||||
['GLdispatch.c'],
|
||||
include_directories : [include_directories('vnd-glapi'), inc_include],
|
||||
link_args : ['-Wl,--version-script', _ver_script],
|
||||
link_with : libglapi,
|
||||
dependencies : [
|
||||
idep_trace, idep_glvnd_pthread, idep_app_error_check, dep_dl,
|
||||
],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
link_depends : [_ver_script],
|
||||
install : true,
|
||||
version : '0.0.0',
|
||||
)
|
||||
|
||||
inc_dispatch = include_directories('.')
|
||||
|
||||
idep_gldispatch = declare_dependency(
|
||||
link_with : libgldispatch,
|
||||
include_directories : inc_dispatch,
|
||||
)
|
||||
|
|
@ -120,3 +120,4 @@ g_glapi_mapi_glesv2_tmp.h : $(glapi_gen_mapi_deps)
|
|||
endif
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
EXTRA_DIST = meson.build
|
||||
|
|
104
src/GLdispatch/vnd-glapi/meson.build
Normal file
104
src/GLdispatch/vnd-glapi/meson.build
Normal file
|
@ -0,0 +1,104 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
inc_vnd_glapi = include_directories('.')
|
||||
|
||||
_libglapi_sources = []
|
||||
if have_tls
|
||||
_libglapi_sources += 'u_current_tls.c'
|
||||
else
|
||||
_libglapi_sources += 'u_current_tsd.c'
|
||||
endif
|
||||
|
||||
_entry_files = []
|
||||
if gl_dispatch_type == 'pure_c'
|
||||
_entry_files += 'entry_pure_c.c'
|
||||
else
|
||||
_entry_files += 'entry_common.c'
|
||||
if gl_dispatch_type != 'arm_tsd'
|
||||
_entry_files += 'entry_simple_asm.c'
|
||||
endif
|
||||
if gl_dispatch_type == 'x86_tls'
|
||||
_entry_files += 'entry_x86_tls.c'
|
||||
elif gl_dispatch_type == 'x86_tsd'
|
||||
_entry_files += 'entry_x86_tsd.c'
|
||||
elif gl_dispatch_type == 'x86_64_tls'
|
||||
_entry_files += 'entry_x86_64_tls.c'
|
||||
elif gl_dispatch_type == 'x86_64_tsd'
|
||||
_entry_files += 'entry_x86_64_tsd.c'
|
||||
elif gl_dispatch_type == 'arm_tsd'
|
||||
_entry_files += 'entry_armv7_tsd.c'
|
||||
elif gl_dispatch_type == 'aarch64_tsd'
|
||||
_entry_files += 'entry_aarch64_tsd.c'
|
||||
elif gl_dispatch_type == 'ppc64le_tls'
|
||||
_entry_files += 'entry_aarch64_tls.c'
|
||||
elif gl_dispatch_type == 'ppc64le_tsd'
|
||||
_entry_files += 'entry_aarch64_tsd.c'
|
||||
else
|
||||
error('No matching ASM file for @0@'.format(gl_dispatch_type))
|
||||
endif
|
||||
endif
|
||||
|
||||
libglapi = static_library(
|
||||
'libglapi',
|
||||
[
|
||||
'mapi_glapi.c',
|
||||
'stub.c',
|
||||
'table.c',
|
||||
_libglapi_sources,
|
||||
glapi_mapi_tmp_h,
|
||||
_entry_files,
|
||||
],
|
||||
c_args : ['-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path())],
|
||||
include_directories : inc_include,
|
||||
dependencies : idep_utils_misc,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
foreach g : ['gl', 'opengl', 'glesv1', 'glesv2']
|
||||
name = 'glapi_' + g
|
||||
header = get_variable('g_glapi_mapi_@0@_tmp_h'.format(g))
|
||||
|
||||
_lib = static_library(
|
||||
name,
|
||||
['stub.c', _entry_files, header],
|
||||
c_args : [
|
||||
'-DSTATIC_DISPATCH_ONLY',
|
||||
'-DMAPI_ABI_HEADER="@0@"'.format(header.full_path()),
|
||||
],
|
||||
include_directories : [inc_include, inc_util],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
_dep = declare_dependency(
|
||||
link_with : _lib,
|
||||
include_directories : inc_vnd_glapi,
|
||||
)
|
||||
|
||||
set_variable('idep_' + name, _dep)
|
||||
endforeach
|
||||
|
|
@ -30,7 +30,9 @@ EXTRA_DIST = \
|
|||
generate/xml/gl.xml \
|
||||
generate/xml/gl_other.xml \
|
||||
generate/xml/glx.xml \
|
||||
generate/xml/glx_other.xml
|
||||
generate/xml/glx_other.xml \
|
||||
generate/meson.build \
|
||||
meson.build
|
||||
|
||||
clean-local:
|
||||
rm -f generate/*.pyc
|
||||
|
|
|
@ -59,4 +59,5 @@ TESTS = ogl-symbol-check.sh
|
|||
|
||||
EXTRA_DIST = \
|
||||
ogl-symbol-check.sh \
|
||||
ogl.symbols
|
||||
ogl.symbols \
|
||||
meson.build
|
||||
|
|
61
src/OpenGL/meson.build
Normal file
61
src/OpenGL/meson.build
Normal file
|
@ -0,0 +1,61 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
libopengl_main = static_library(
|
||||
'opengl_main',
|
||||
['libopengl.c'],
|
||||
include_directories : [inc_util, inc_vnd_glapi, inc_include, inc_dispatch],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
libOpenGL = shared_library(
|
||||
'OpenGL',
|
||||
link_whole : libopengl_main,
|
||||
dependencies : [idep_gldispatch, idep_glapi_opengl, idep_utils_misc],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
install : true,
|
||||
version : '0.0.0',
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
libOpenGL,
|
||||
filebase : 'opengl',
|
||||
description : 'OpenGL (without GLX) library and headers.',
|
||||
version : '4.5',
|
||||
)
|
||||
|
||||
test(
|
||||
'OpenGL symbols check',
|
||||
prog_py,
|
||||
args : [
|
||||
files_symbols_check,
|
||||
'--nm', prog_nm.path(),
|
||||
'--lib', libOpenGL,
|
||||
'--symbols-file', files('ogl.symbols'),
|
||||
],
|
||||
suite : ['symbols'],
|
||||
)
|
74
src/generate/meson.build
Normal file
74
src/generate/meson.build
Normal file
|
@ -0,0 +1,74 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
|
||||
foreach t : [['glapi_mapi_tmp.h', 'gldispatch'],
|
||||
['g_glapi_mapi_gl_tmp.h', 'gl'],
|
||||
['g_glapi_mapi_opengl_tmp.h', 'opengl'],
|
||||
['g_glapi_mapi_glesv1_tmp.h', 'glesv1'],
|
||||
['g_glapi_mapi_glesv2_tmp.h', 'glesv2']]
|
||||
file = t[0]
|
||||
target = t[1]
|
||||
var = file.underscorify()
|
||||
|
||||
_t = custom_target(
|
||||
file,
|
||||
input : ['gen_gldispatch_mapi.py', 'xml/gl.xml', 'xml/gl_other.xml'],
|
||||
output : file,
|
||||
command : [prog_py, '@INPUT0@', target, '@INPUT1@', '@INPUT2@'],
|
||||
depend_files : files('genCommon.py'),
|
||||
capture : true,
|
||||
)
|
||||
|
||||
set_variable(var, _t)
|
||||
endforeach
|
||||
|
||||
foreach target : ['header', 'source']
|
||||
ext = target == 'header' ? 'h' : 'c'
|
||||
_t = custom_target(
|
||||
'g_egldispatchstubs.' + ext,
|
||||
input : ['gen_egl_dispatch.py', 'eglFunctionList.py', 'xml/egl.xml'],
|
||||
output : ['g_egldispatchstubs.' + ext],
|
||||
command : [
|
||||
prog_py, '@INPUT0@', target, '@INPUT1@', '@INPUT2@',
|
||||
],
|
||||
depend_files : files('genCommon.py'),
|
||||
capture : true,
|
||||
)
|
||||
|
||||
set_variable('g_egldispatchstubs_' + ext, _t)
|
||||
endforeach
|
||||
|
||||
g_libglglxwrapper_c = custom_target(
|
||||
'g_libglglxwrapper.c',
|
||||
input : ['gen_libgl_glxstubs.py', 'xml/glx.xml', 'xml/glx_other.xml'],
|
||||
output : ['g_libglglxwrapper.c'],
|
||||
command : [prog_py, '@INPUT@'],
|
||||
depend_files : files('genCommon.py'),
|
||||
capture : true,
|
||||
)
|
||||
|
48
src/meson.build
Normal file
48
src/meson.build
Normal file
|
@ -0,0 +1,48 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
subdir('util')
|
||||
subdir('generate')
|
||||
subdir('GLdispatch')
|
||||
subdir('OpenGL')
|
||||
|
||||
if get_option('egl')
|
||||
subdir('EGL')
|
||||
endif
|
||||
|
||||
if with_glx
|
||||
subdir('GLX')
|
||||
subdir('GL')
|
||||
endif
|
||||
|
||||
if get_option('gles1')
|
||||
subdir('GLESv1')
|
||||
endif
|
||||
if get_option('gles2')
|
||||
subdir('GLESv2')
|
||||
endif
|
||||
|
|
@ -6,7 +6,7 @@ noinst_HEADERS = \
|
|||
trace.h \
|
||||
cJSON.h
|
||||
|
||||
EXTRA_DIST = uthash cJSON
|
||||
EXTRA_DIST = uthash cJSON meson.build
|
||||
|
||||
noinst_LTLIBRARIES =
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/include
|
||||
|
|
100
src/util/meson.build
Normal file
100
src/util/meson.build
Normal file
|
@ -0,0 +1,100 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
inc_util = include_directories('.')
|
||||
|
||||
libglvnd_pthread = static_library(
|
||||
'glvnd_pthread',
|
||||
['glvnd_pthread.c'],
|
||||
dependencies : dep_dl,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
idep_glvnd_pthread = declare_dependency(
|
||||
link_with : libglvnd_pthread,
|
||||
include_directories : inc_util,
|
||||
)
|
||||
|
||||
libapp_error_check = static_library(
|
||||
'app_error_check',
|
||||
['app_error_check.c'],
|
||||
include_directories : inc_include,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
idep_app_error_check = declare_dependency(
|
||||
link_with : libapp_error_check,
|
||||
include_directories : inc_util,
|
||||
)
|
||||
|
||||
libutils_misc = static_library(
|
||||
'utils_misc',
|
||||
['utils_misc.c'],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
idep_utils_misc = declare_dependency(
|
||||
link_with : libutils_misc,
|
||||
include_directories : inc_util,
|
||||
)
|
||||
|
||||
libtrace = static_library(
|
||||
'trace',
|
||||
['trace.c'],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
idep_trace = declare_dependency(
|
||||
link_with : libtrace,
|
||||
include_directories : inc_util,
|
||||
)
|
||||
|
||||
inc_uthash = include_directories('uthash/src')
|
||||
|
||||
libwinsys_dispatch = static_library(
|
||||
'winsys_dispatch',
|
||||
['winsys_dispatch.c'],
|
||||
include_directories : [inc_include, inc_uthash],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
idep_winsys_dispatch = declare_dependency(
|
||||
link_with : libwinsys_dispatch,
|
||||
include_directories : [inc_util, inc_uthash],
|
||||
)
|
||||
|
||||
libcjson = static_library(
|
||||
'cJSON',
|
||||
['cJSON.c'],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
idep_cjson = declare_dependency(
|
||||
link_with : libcjson,
|
||||
include_directories : inc_util,
|
||||
)
|
||||
|
|
@ -43,7 +43,8 @@ check_PROGRAMS =
|
|||
EXTRA_DIST = $(TESTS) \
|
||||
glxenv.sh \
|
||||
eglenv.sh \
|
||||
json
|
||||
json \
|
||||
meson.build
|
||||
|
||||
CFLAGS_COMMON = \
|
||||
-I$(top_srcdir)/include \
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -4,7 +4,7 @@ noinst_HEADERS = \
|
|||
EGL_dummy.h
|
||||
|
||||
check_LTLIBRARIES =
|
||||
|
||||
|
||||
check_LTLIBRARIES += libpatchentrypoints.la
|
||||
libpatchentrypoints_la_CFLAGS = \
|
||||
-I$(top_srcdir)/src/GLdispatch \
|
||||
|
@ -65,3 +65,5 @@ libEGL_dummy1_la_LIBADD = $(EGL_DUMMY_LIBADD_COMMON)
|
|||
libEGL_dummy1_la_LDFLAGS = $(EGL_DUMMY_LDFLAGS_COMMON)
|
||||
|
||||
endif # ENABLE_EGL
|
||||
|
||||
EXTRA_DIST = meson.build
|
82
tests/dummy/meson.build
Normal file
82
tests/dummy/meson.build
Normal file
|
@ -0,0 +1,82 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
libpatchentrypoints = static_library(
|
||||
'patchentrypoints',
|
||||
['patchentrypoints.c'],
|
||||
include_directories : [inc_include, inc_util, inc_dispatch],
|
||||
)
|
||||
|
||||
prog_cp = find_program('cp')
|
||||
|
||||
if with_glx
|
||||
libGLX_dummy = shared_module(
|
||||
'GLX_dummy',
|
||||
['GLX_dummy.c'],
|
||||
include_directories : [inc_dispatch, inc_glx, inc_include],
|
||||
link_with: [libpatchentrypoints],
|
||||
dependencies : [idep_trace, idep_utils_misc],
|
||||
)
|
||||
|
||||
# The ICD loader expects to load a .so.0, but meson generates the .X.Y.Z
|
||||
# links at install time, the build time directories only have the plain .so
|
||||
# files, so we copy the .so to .so.0 so tests will work
|
||||
custom_target(
|
||||
'GLX_dummy.so.0',
|
||||
input : [libGLX_dummy],
|
||||
output : 'libGLX_dummy.so.0',
|
||||
command : [prog_cp, '@INPUT@', '@OUTPUT@'],
|
||||
build_by_default : true,
|
||||
)
|
||||
endif
|
||||
|
||||
if get_option('egl')
|
||||
foreach v : ['0', '1']
|
||||
_lib = shared_module(
|
||||
'EGL_dummy' + v,
|
||||
['EGL_dummy.c'],
|
||||
c_args : ['-DDUMMY_VENDOR_NAME="dummy@0@"'.format(v)],
|
||||
include_directories : [inc_include],
|
||||
link_with: [libpatchentrypoints],
|
||||
dependencies : [idep_glvnd_pthread],
|
||||
)
|
||||
|
||||
set_variable('libEGL_dummy' + v, _lib)
|
||||
|
||||
# see The comment in the with_glx block
|
||||
custom_target(
|
||||
'EGL_dummy@0@.so.0'.format(v),
|
||||
input : _lib,
|
||||
output : 'libEGL_dummy@0@.so.0'.format(v),
|
||||
command : [prog_cp, '@INPUT@', '@OUTPUT@'],
|
||||
build_by_default : true,
|
||||
)
|
||||
endforeach
|
||||
endif
|
||||
|
||||
dummy_build_dir = meson.current_build_dir()
|
||||
|
214
tests/meson.build
Normal file
214
tests/meson.build
Normal file
|
@ -0,0 +1,214 @@
|
|||
# Copyright © 2019 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and/or associated documentation files (the
|
||||
# "Materials"), to deal in the Materials without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
# permit persons to whom the Materials are furnished to do so, subject to
|
||||
# the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# unaltered in all copies or substantial portions of the Materials.
|
||||
# Any additions, deletions, or changes to the original source files
|
||||
# must be clearly indicated in accompanying documentation.
|
||||
|
||||
# If only executable code is distributed, then the accompanying
|
||||
# documentation must state that "this software is based in part on the
|
||||
# work of the Khronos Group."
|
||||
|
||||
# THE MATERIALS ARE 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
|
||||
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
|
||||
subdir('dummy')
|
||||
|
||||
exe_gldispatch = executable(
|
||||
'testgldispatch',
|
||||
['testgldispatch.c'],
|
||||
include_directories : [inc_include],
|
||||
link_with : [libOpenGL, libpatchentrypoints],
|
||||
dependencies : [idep_gldispatch, idep_utils_misc, dep_threads],
|
||||
)
|
||||
|
||||
foreach k : [['static', ['-s']],
|
||||
['static thr', ['-s', '-t']],
|
||||
['generated', ['-g']],
|
||||
['generated end', ['-g', '-l']],
|
||||
['generated thr', ['-g', '-t']],
|
||||
['generated thr end', ['-g', '-t', '-l']],
|
||||
['patched', ['-s', '-g', '-p']],
|
||||
['patched end', ['-s', '-g', '-p', '-l']],
|
||||
['patched thr', ['-s', '-g', '-p', '-t']],
|
||||
['patched thr end', ['-s', '-g', '-p', '-t', '-l']]]
|
||||
test(
|
||||
'gldispatch ' + k[0],
|
||||
exe_gldispatch,
|
||||
args : k[1],
|
||||
suite : ['gldispatch'],
|
||||
)
|
||||
endforeach
|
||||
|
||||
test(
|
||||
'testgldispatchthread',
|
||||
executable(
|
||||
'testgldispatchthread',
|
||||
['testgldispatchthread.c'],
|
||||
include_directories : [inc_include],
|
||||
dependencies : [idep_gldispatch, dep_threads],
|
||||
),
|
||||
suite : ['gldispatch'],
|
||||
)
|
||||
|
||||
_env_ld = 'LD_LIBRARY_PATH=@0@/'.format(dummy_build_dir)
|
||||
|
||||
if with_glx
|
||||
env_glx = [
|
||||
'__GLX_FORCE_VENDOR_LIBRARY_0=dummy',
|
||||
_env_ld,
|
||||
]
|
||||
|
||||
test(
|
||||
'glxcreatecontext',
|
||||
executable(
|
||||
'glxcreatecontext',
|
||||
['testglxcreatecontext.c', 'test_utils.c'],
|
||||
include_directories : [inc_include],
|
||||
link_with : libOpenGL,
|
||||
dependencies : [idep_glx, dep_x11],
|
||||
),
|
||||
env : env_glx,
|
||||
suite : ['glx'],
|
||||
)
|
||||
|
||||
exe_glxmakecurrent = executable(
|
||||
'glxmakecurrent',
|
||||
['testglxmakecurrent.c', 'test_utils.c'],
|
||||
include_directories : [inc_include],
|
||||
link_with : [libOpenGL],
|
||||
dependencies : [
|
||||
dep_dl, dep_x11, idep_glvnd_pthread, idep_trace, idep_utils_misc,
|
||||
idep_glx,
|
||||
],
|
||||
)
|
||||
|
||||
foreach t : [['basic', ['-t', '1', '-i', '1'], env_glx],
|
||||
['loop', ['-t', '1', '-i', '250'], env_glx],
|
||||
['threads', ['-t', '5', '-i', '20000'], [env_glx, 'LD_PRELOAD=libpthread.so.0']],
|
||||
]
|
||||
test(
|
||||
'glxmakecurrent (@0@)'.format(t[0]),
|
||||
exe_glxmakecurrent,
|
||||
args : t[1],
|
||||
env : t[2],
|
||||
suite : ['glx'],
|
||||
)
|
||||
endforeach
|
||||
|
||||
test(
|
||||
'glxmakecurrent (oldlink)',
|
||||
executable(
|
||||
'glxmakecurrent_oldlink',
|
||||
['testglxmakecurrent.c', 'test_utils.c'],
|
||||
include_directories : [inc_include],
|
||||
link_with : [libGL],
|
||||
dependencies : [
|
||||
dep_dl, dep_x11, idep_glvnd_pthread, idep_trace, idep_utils_misc,
|
||||
],
|
||||
),
|
||||
args : ['-t', '1', '-i', '1'],
|
||||
env : env_glx,
|
||||
suite : ['glx'],
|
||||
)
|
||||
|
||||
exe_glxgetprocaddress = executable(
|
||||
'glxgetprocaddress',
|
||||
['testglxgetprocaddress.c'],
|
||||
include_directories : [inc_include],
|
||||
dependencies : [dep_x11, idep_glx, idep_gldispatch],
|
||||
)
|
||||
|
||||
test(
|
||||
'glxgetprocess',
|
||||
exe_glxgetprocaddress,
|
||||
env : env_glx,
|
||||
suite : ['glx'],
|
||||
)
|
||||
|
||||
test(
|
||||
'glxgetprocess_genentry',
|
||||
exe_glxgetprocaddress,
|
||||
env : env_glx,
|
||||
suite : ['glx'],
|
||||
)
|
||||
|
||||
test(
|
||||
'glxgetprocaddress_genentry',
|
||||
executable(
|
||||
'testglxgetprocaddress_genentry',
|
||||
['testglxgetprocaddress_genentry.c'],
|
||||
include_directories : [inc_include],
|
||||
dependencies : [dep_x11, idep_glx],
|
||||
),
|
||||
env : env_glx,
|
||||
suite : ['glx'],
|
||||
)
|
||||
|
||||
test(
|
||||
'glxgetclientstr',
|
||||
executable(
|
||||
'glxgetclientstr',
|
||||
['testglxgetclientstr.c'],
|
||||
include_directories : [inc_include],
|
||||
link_with : libOpenGL,
|
||||
dependencies : [dep_x11, idep_glx, idep_trace, idep_utils_misc],
|
||||
),
|
||||
env : env_glx,
|
||||
suite : ['glx'],
|
||||
)
|
||||
|
||||
test(
|
||||
'glxgetqueryversion',
|
||||
executable(
|
||||
'glxqueryversion',
|
||||
['testglxqueryversion.c'],
|
||||
include_directories : [inc_include],
|
||||
link_with : libOpenGL,
|
||||
dependencies : [dep_x11, idep_glx],
|
||||
),
|
||||
env : env_glx,
|
||||
suite : ['glx'],
|
||||
)
|
||||
endif
|
||||
|
||||
if get_option('egl')
|
||||
env_egl = [
|
||||
'__EGL_VENDOR_LIBRARY_DIRS=@0@'.format(join_paths(meson.current_source_dir(), 'json')),
|
||||
_env_ld,
|
||||
]
|
||||
|
||||
foreach t : [['egldisplay', [], []],
|
||||
['egldevice', [], []],
|
||||
['eglgetprocaddress', [], []],
|
||||
['eglmakecurrent', [libOpenGL], [idep_utils_misc]],
|
||||
['eglerror', [libOpenGL], []],
|
||||
['egldebug', [], []]]
|
||||
test(
|
||||
t[0],
|
||||
executable(
|
||||
t[0],
|
||||
['test@0@.c'.format(t[0]), 'egl_test_utils.c'],
|
||||
include_directories : [inc_include],
|
||||
link_with : [libEGL, t[1]],
|
||||
dependencies : [t[2]],
|
||||
),
|
||||
env : env_egl,
|
||||
suite : ['egl'],
|
||||
)
|
||||
endforeach
|
||||
endif
|
||||
|
Loading…
Reference in a new issue