mesonbuild/meson

Meson needs native understanding of symbol version scripts

Open

#3,047 opened on Feb 12, 2018

 (29 comments) (16 reactions) (0 assignees)Python (1,465 forks)batch import
compilersenhancementhelp wanted

Repository metrics

Stars
 (4,978 stars)
PR merge metrics
 (Avg merge 139d 13h) (51 merged PRs in 30d)

Description

Meson doesn't seem to understand much about linkers; most of the projects porting to meson do something like this:

mapfile = 'libgusb.ver'
vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
gusb = shared_library(
  'gusb',
  sources : [
    'gusb-context.c',
  ],
  soversion : lt_current,
  version : lt_version,
  dependencies : [
    libusb,
  ],
  link_args : vflag,
  link_depends : mapfile,
  install : true
)

Which is fine, unless you discover that OS-X doesn't support --version-script : https://github.com/hughsie/libgusb/issues/11

Rather than have to do evil things to the meson.build file to support OS-X, I would much prefer fr meson to know what a version-script is, rather than just dumping it in a command line. In the case of OS-X the version script could just be ignored. Ideas welcome, thanks!

Contributor guide