+ drv_path, lib_name)
+
+ is_experimental = run_command(is_experimental_cmd,
+ files(version_map)).returncode()
+
+ if is_experimental != 0
+ lib_version = experimental_abi_version
+ so_version = experimental_so_version
+ else
+ lib_version = abi_version
+ so_version = stable_so_version
+ endif
+
+ # now build the static driver
+ static_lib = static_library(lib_name,
+ sources,
+ objects: objs,
+ include_directories: includes,
+ dependencies: static_deps,
+ c_args: cflags,
+ install: true)
+
+ # now build the shared driver
+ version_map = '@0@/@1@/@2@_version.map'.format(
+ meson.current_source_dir(),
+ drv_path, lib_name)
+ implib = dir_name + '.dll.a'
+
+ def_file = custom_target(lib_name + '_def',
+ command: [map_to_def_cmd, '@INPUT@', '@OUTPUT@'],
+ input: version_map,
+ output: '@0@_exports.def'.format(lib_name))
+ lk_deps = [version_map, def_file]
+ if is_windows
+ lk_args = ['-Wl,/def:' + def_file.full_path(),
+ '-Wl,/implib:lib\\' + implib]
+ else
+ lk_args = ['-Wl,--version-script=' + version_map]
+ # on unix systems check the output of the
+ # experimental syms script, using it as a
+ # dependency of the .so build
+ lk_deps += custom_target(lib_name + '.exp_chk',
+ command: [check_experimental_syms,
+ version_map, '@INPUT@'],
+ capture: true,
+ input: static_lib,
+ output: lib_name + '.exp_chk')
+ endif
+
+ shared_lib = shared_library(lib_name,