Windows does not support linker option '/-no-whole-archive'
or '/whole-archive'. The patch removes them under Windows build.

Signed-off-by: William Tu <u9012...@gmail.com>
---
 buildtools/pkg-config/meson.build | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/buildtools/pkg-config/meson.build 
b/buildtools/pkg-config/meson.build
index 0412883c8f..989033db89 100644
--- a/buildtools/pkg-config/meson.build
+++ b/buildtools/pkg-config/meson.build
@@ -40,7 +40,13 @@ Use libdpdk.pc instead of this file to query DPDK 
compile/link arguments''',
 platform_flags = []
 if not is_windows
     platform_flags += ['-Wl,--export-dynamic'] # ELF only
+    libraries_args = ['-Wl,--whole-archive'] +
+                     dpdk_drivers + dpdk_static_libraries +
+                     ['-Wl,--no-whole-archive'] + platform_flags
+else
+     libraries_args = dpdk_drivers + dpdk_static_libraries
 endif
+
 pkg.generate(name: 'DPDK', # main DPDK pkgconfig file
         filebase: 'libdpdk',
         version: meson.project_version(),
@@ -49,9 +55,7 @@ Note that CFLAGS might contain an -march flag higher than 
typical baseline.
 This is required for a number of static inline functions in the public 
headers.''',
         requires: ['libdpdk-libs', libbsd], # may need libbsd for string funcs
                       # if libbsd is not enabled, then this is blank
-        libraries_private: ['-Wl,--whole-archive'] +
-            dpdk_drivers + dpdk_static_libraries +
-            ['-Wl,--no-whole-archive'] + platform_flags
+        libraries_private: libraries_args
 )
 
 # For static linking with dependencies as shared libraries,
-- 
2.33.0.windows.2

Reply via email to