meson: set visibility flag when compiler supports it

Since vtest_server and the tests make use of private interfaces we must
mirror the autotoosl build that keeps the private interfaces in a static
library so that these functions can be called by the test code. The main
library that get installed then uses this static library and adds the
exported interface.

Closes #152

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Gert Wollny 5 years ago
parent 1686cf92a7
commit 1e581b6b49
  1. 10
      meson.build
  2. 53
      src/meson.build
  3. 2
      tests/fuzzer/meson.build
  4. 4
      tests/meson.build
  5. 4
      vtest/meson.build

@ -60,6 +60,16 @@ foreach w : warnings
endif
endforeach
flags = [
'-fvisibility=hidden',
]
foreach f : flags
if cc.has_argument(f)
add_project_arguments(f, language : 'c')
endif
endforeach
prog_python = import('python').find_installation('python3')
libdrm_dep = dependency('libdrm', version : '>=2.4.50')

@ -23,12 +23,10 @@
subdir('gallium')
virglrenderer_sources = [
virgl_sources = [
'iov.c',
'virgl_hw.h',
'virgl_protocol.h',
'virglrenderer.c',
'virglrenderer.h',
'vrend_blitter.c',
'vrend_blitter.h',
'vrend_debug.c',
@ -48,19 +46,25 @@ virglrenderer_sources = [
'vrend_util.h',
]
virglrenderer_egl_sources = [
virglrenderer_sources = [
'virglrenderer.c',
'virglrenderer.h',
]
virgl_egl_sources = [
'virgl_gbm.c',
'virgl_gbm.h',
'virgl_egl_context.c',
'virgl_egl.h',
]
virglrenderer_glx_sources = [
virgl_glx_sources = [
'virgl_glx_context.c',
'virgl_glx.h',
]
virglrenderer_depends = [
virgl_depends = [
gallium_dep,
epoxy_dep,
libdrm_dep,
@ -69,35 +73,48 @@ virglrenderer_depends = [
]
if have_egl
virglrenderer_sources += virglrenderer_egl_sources
virglrenderer_depends += [gbm_dep]
virgl_sources += virgl_egl_sources
virgl_depends += [gbm_dep]
endif
if have_glx
virglrenderer_sources += virglrenderer_glx_sources
virglrenderer_depends += [glx_dep]
virgl_sources += virgl_glx_sources
virgl_depends += [glx_dep]
endif
libvirgl = static_library(
'virgl',
virgl_sources,
include_directories: [inc_gallium, inc_configuration],
dependencies : virgl_depends,
)
libvirgl_inc = [
inc_gallium,
inc_configuration,
include_directories('.')
]
libvirgl_dep = declare_dependency(
link_with: libvirgl,
include_directories: libvirgl_inc
)
libvirglrenderer = shared_library(
'virglrenderer',
virglrenderer_sources,
include_directories: [inc_gallium, inc_configuration],
dependencies : virglrenderer_depends,
dependencies : [virgl_depends, libvirgl_dep],
version : binary_age.to_string() + '.'
+ interface_age.to_string() + '.'
+ revision.to_string(),
install : true
)
libvirglrenderer_inc = [
inc_gallium,
inc_configuration,
include_directories('.')
]
libvirglrenderer_dep = declare_dependency(
link_with: libvirglrenderer,
include_directories: libvirglrenderer_inc
include_directories: libvirgl_inc,
dependencies : [libvirgl_dep, gallium_dep]
)
install_headers('virglrenderer.h', subdir : 'virgl')

@ -29,5 +29,5 @@ virgl_fuzzer = executable(
'virgl_fuzzer.c',
c_args : [ '-fsanitize=address', '-fsanitize=fuzzer' ],
link_args : [ '-fsanitize=address', '-fsanitize=fuzzer' ],
dependencies : [libvirglrenderer_dep, epoxy_dep]
dependencies : [libvirgl_dep, gallium_dep, epoxy_dep]
)

@ -30,11 +30,11 @@ libvrtest_sources = [
'testvirgl_encode.h',
]
libvrtest = library(
libvrtest = static_library(
'vrtest',
libvrtest_sources,
dependencies : [
libvirglrenderer_dep,
libvirgl_dep,
gallium_dep,
check_dep
]

@ -36,7 +36,7 @@ virgl_test_server_sources = [
virgl_test_server = executable(
'virgl_test_server',
virgl_test_server_sources,
dependencies : libvirglrenderer_dep,
dependencies : [libvirglrenderer_dep, gallium_dep],
install : true
)
@ -55,6 +55,6 @@ if with_fuzzer
c_args : [ '-fsanitize=address', '-fsanitize=fuzzer' ],
link_args : [ '-fsanitize=address', '-fsanitize=fuzzer' ],
objects : vtest_obj,
dependencies : libvirglrenderer_dep
dependencies : libvirgl_dep
)
endif

Loading…
Cancel
Save