build: provide suitable error for "both" libraries option

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>
This commit is contained in:
Bruce Richardson 2021-01-11 13:55:59 +00:00 committed by Thomas Monjalon
parent 762bfccc8a
commit 08895f10e7

View 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