build: add module definition files for Windows

Updated lib/meson.build to create shared libraries on Windows.
Added DEF files to list the exports for the eal and kvargs libraries.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
This commit is contained in:
Anand Rawat 2019-04-01 20:54:53 -07:00 committed by Thomas Monjalon
parent 58836e93f5
commit 82ba4416dd
4 changed files with 29 additions and 3 deletions

View File

@ -290,6 +290,7 @@ M: Anand Rawat <anand.rawat@intel.com>
M: Ranjit Menon <ranjit.menon@intel.com>
F: kernel/windows/
F: lib/librte_eal/windows/
F: lib/librte_eal/rte_eal_exports.def
Core Libraries

View File

@ -0,0 +1,9 @@
EXPORTS
__rte_panic
rte_eal_get_configuration
rte_eal_init
rte_eal_mp_remote_launch
rte_eal_mp_wait_lcore
rte_eal_remote_launch
rte_log
rte_vlog

View File

@ -0,0 +1,7 @@
EXPORTS
rte_kvargs_count
rte_kvargs_free
rte_kvargs_parse
rte_kvargs_process
rte_kvargs_parse_delim
rte_kvargs_strcmp

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
# Copyright(c) 2017-2019 Intel Corporation
# process all libraries equally, as far as possible
@ -117,14 +117,23 @@ foreach l:libraries
objs += static_lib.extract_all_objects(recursive: false)
version_map = '@0@/@1@/rte_@2@_version.map'.format(
meson.current_source_dir(), dir_name, name)
exports = []
implib = dir_name + '.dll.a'
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]
else
lk_args = ['-Wl,--version-script=' + version_map]
endif
shared_lib = shared_library(libname,
sources,
objects: objs,
c_args: cflags,
dependencies: shared_deps,
include_directories: includes,
link_args: '-Wl,--version-script=' + version_map,
link_depends: version_map,
link_args: lk_args,
link_depends: [version_map, exports],
version: lib_version,
soversion: so_version,
install: true)