Commit c33afe78 authored by Niklas Haas's avatar Niklas Haas

meson: exclude external libs on supported platforms

This prevents e.g. leaking glslang symbols, which is the main reason we
switched to the linker script in 6835ae5d. Since that caused other
problems as well (notably failing on several platforms), and being just
as annoying to work with, I decided to revert that series of commits and
go back to the #pragma GCC approach - this at least works on all
platforms without any harm done. (If the pragma doesn't exist, it will
just get silently ignored)

And to solve the original motivation, we use the hide external libs flag.
parent 6e668b40
......@@ -24,6 +24,8 @@ build_opts = [
'-Werror=implicit-function-declaration',
]
link_args = []
cc = meson.get_compiler('c')
cxx = meson.get_compiler('cpp')
......@@ -36,6 +38,11 @@ if cc.get_id() == 'clang'
build_opts += ['-Wno-missing-braces']
endif
vflag = '-Wl,--exclude-libs=ALL'
if cc.has_link_argument(vflag)
link_args += [vflag]
endif
# Global dependencies
build_deps = [
dependency('threads'),
......@@ -208,6 +215,7 @@ lib = library('placebo', sources,
dependencies: build_deps,
soversion: apiver,
include_directories: inc,
link_args: link_args,
)
# Install process
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment