build: provide suitable error for "both" libraries option
authorBruce Richardson <bruce.richardson@intel.com>
Mon, 11 Jan 2021 13:55:59 +0000 (13:55 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 20 Jan 2021 01:03:08 +0000 (02:03 +0100)
Rather than having the DPDK configuration error out when linking apps
and examples when "both" is select for "default_library" option, we can
detect that setting earlier in the build config and provide a suitable
error message to the user.

Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Andrew Boyer <aboyer@pensando.io>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
config/meson.build

index 1e6dfe0..9abb30c 100644 (file)
@@ -330,3 +330,12 @@ if get_option('b_lto')
                add_project_link_arguments('-Wno-lto-type-mismatch', language: 'c')
        endif
 endif
+
+if get_option('default_library') == 'both'
+       error( '''
+    Unsupported value "both" for "default_library" option.
+
+    NOTE: DPDK always builds both shared and static libraries.  Please set
+    "default_library" to either "static" or "shared" to select default linkage
+    for apps and any examples.''')
+endif