- if host_machine.system() == 'windows'
- exports = '@0@/@1@/rte_@2@_exports.def'.format(
- meson.current_source_dir(), dir_name, name)
- lk_args = ['-Wl,/def:' + exports, '-Wl,/implib:lib\\' + implib]
+
+ def_file = custom_target(name + '_def',
+ command: [map_to_def_cmd, '@INPUT@', '@OUTPUT@'],
+ input: version_map,
+ output: 'rte_@0@_exports.def'.format(name))
+ if is_windows
+ lk_args = ['-Wl,/def:' + def_file.full_path(),
+ '-Wl,/implib:lib\\' + implib]