vcpkg/ports/dpdk/enable-either-static-or-shared-build.patch

82 lines
3.0 KiB
Diff
Raw Normal View History

diff --git a/config/meson.build b/config/meson.build
index 7134e80..a77f533 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -57,7 +57,9 @@ eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
# driver .so files often depend upon the bus drivers for their connect bus,
# e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need
# to be in the library path, so symlink the drivers from the main lib directory.
-if not is_windows
+if get_option('default_library') == 'static'
+ # skip
+elif not is_windows
meson.add_install_script('../buildtools/symlink-drivers-solibs.sh',
get_option('libdir'), pmd_subdir_opt)
elif meson.version().version_compare('>=0.55.0')
diff --git a/drivers/meson.build b/drivers/meson.build
index 1d8123b..36ab3c0 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -180,7 +180,7 @@ foreach subpath:subdirs
include_directories: includes,
dependencies: static_deps,
c_args: cflags,
- install: true)
+ install: get_option('default_library') == 'static')
# now build the shared driver
version_map = '@0@/@1@/version.map'.format(meson.current_source_dir(), drv_path)
@@ -220,6 +220,7 @@ foreach subpath:subdirs
endif
endif
+ if get_option('default_library') == 'shared'
shared_lib = shared_library(lib_name, sources,
objects: objs,
include_directories: includes,
@@ -237,9 +238,13 @@ foreach subpath:subdirs
shared_dep = declare_dependency(link_with: shared_lib,
include_directories: includes,
dependencies: shared_deps)
+ endif
static_dep = declare_dependency(
include_directories: includes,
dependencies: static_deps)
+ if get_option('default_library') == 'static'
+ shared_dep = static_dep
+ endif
dpdk_drivers += static_lib
diff --git a/lib/meson.build b/lib/meson.build
index 24adbe4..eef6e93 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -192,7 +192,7 @@ foreach l:libraries
c_args: cflags,
dependencies: static_deps,
include_directories: includes,
- install: true)
+ install: get_option('default_library') == 'static')
static_dep = declare_dependency(
include_directories: includes,
dependencies: static_deps)
@@ -246,6 +246,7 @@ foreach l:libraries
output: name + '.sym_chk')
endif
+ if get_option('default_library') == 'shared'
shared_lib = shared_library(libname,
sources,
objects: objs,
@@ -262,6 +263,9 @@ foreach l:libraries
dependencies: shared_deps)
dpdk_libraries = [shared_lib] + dpdk_libraries
+ else
+ shared_dep = static_dep
+ endif
dpdk_static_libraries = [static_lib] + dpdk_static_libraries
set_variable('shared_rte_' + name, shared_dep)