build: fix building without MBIM support

The foxconn shared utils are only built when MBIM is enabled, and
therefore the dell and foxconn plugins should only expect those shared
utils to be present if MBIM is enabled. The foxconn plugin will be
fully disabled when MBIM is disabled.

The fibocom shared utils are only built when MBIM is enabled, and
therefore the fibocom plugin should not expect them built
unconditionally, they will only be present if MBIM is enabled
This commit is contained in:
Aleksander Morgado
2022-10-27 21:31:13 +00:00
parent fb13be6e0e
commit 30d77d378a
2 changed files with 20 additions and 5 deletions

View File

@@ -299,15 +299,23 @@ plugins_shared_reqs = {
'xmm': true, 'xmm': true,
} }
fibocom_shared_reqs = ['xmm']
dell_shared_reqs = ['novatel', 'sierra', 'telit', 'xmm']
if enable_mbim
fibocom_shared_reqs += ['fibocom']
dell_shared_reqs += ['foxconn']
endif
plugins_options_reqs = { plugins_options_reqs = {
'altair-lte': {'available': true, 'shared': []}, 'altair-lte': {'available': true, 'shared': []},
'anydata': {'available': true, 'shared': []}, 'anydata': {'available': true, 'shared': []},
'broadmobi': {'available': true, 'shared': []}, 'broadmobi': {'available': true, 'shared': []},
'cinterion': {'available': true, 'shared': []}, 'cinterion': {'available': true, 'shared': []},
'dell': {'available': true, 'shared': ['foxconn', 'novatel', 'sierra', 'telit', 'xmm']}, 'dell': {'available': true, 'shared': dell_shared_reqs},
'dlink': {'available': true, 'shared': []}, 'dlink': {'available': true, 'shared': []},
'fibocom': {'available': true, 'shared': ['fibocom', 'xmm']}, 'fibocom': {'available': true, 'shared': fibocom_shared_reqs},
'foxconn': {'available': true, 'shared': ['foxconn']}, 'foxconn': {'available': enable_mbim, 'shared': ['foxconn']},
'generic': {'available': true, 'shared': []}, 'generic': {'available': true, 'shared': []},
'gosuncn': {'available': true, 'shared': []}, 'gosuncn': {'available': true, 'shared': []},
'haier': {'available': true, 'shared': []}, 'haier': {'available': true, 'shared': []},

View File

@@ -315,13 +315,16 @@ if plugins_options['dell']
plugins_test_udev_rules_dir_c_args += test_udev_rules_dir_c_args plugins_test_udev_rules_dir_c_args += test_udev_rules_dir_c_args
incs = plugins_incs + [ incs = plugins_incs + [
foxconn_inc,
novatel_inc, novatel_inc,
sierra_inc, sierra_inc,
telit_inc, telit_inc,
xmm_inc, xmm_inc,
] ]
if enable_mbim
incs += [foxconn_inc]
endif
plugins += {'plugin-dell': { plugins += {'plugin-dell': {
'plugin': true, 'plugin': true,
'module': {'sources': files('dell/mm-plugin-dell.c'), 'include_directories': incs, 'c_args': test_udev_rules_dir_c_args + ['-DMM_MODULE_NAME="dell"']}, 'module': {'sources': files('dell/mm-plugin-dell.c'), 'include_directories': incs, 'c_args': test_udev_rules_dir_c_args + ['-DMM_MODULE_NAME="dell"']},
@@ -348,12 +351,16 @@ if plugins_options['fibocom']
test_udev_rules_dir_c_args = ['-DTESTUDEVRULESDIR_FIBOCOM="@0@"'.format(plugins_dir / 'fibocom')] test_udev_rules_dir_c_args = ['-DTESTUDEVRULESDIR_FIBOCOM="@0@"'.format(plugins_dir / 'fibocom')]
plugins_test_udev_rules_dir_c_args += test_udev_rules_dir_c_args plugins_test_udev_rules_dir_c_args += test_udev_rules_dir_c_args
incs = plugins_incs + [xmm_inc]
sources = files( sources = files(
'fibocom/mm-broadband-bearer-fibocom-ecm.c', 'fibocom/mm-broadband-bearer-fibocom-ecm.c',
'fibocom/mm-broadband-modem-fibocom.c', 'fibocom/mm-broadband-modem-fibocom.c',
'fibocom/mm-plugin-fibocom.c', 'fibocom/mm-plugin-fibocom.c',
) )
if enable_mbim if enable_mbim
incs += [fibocom_inc]
sources += files( sources += files(
'fibocom/mm-broadband-modem-mbim-xmm-fibocom.c', 'fibocom/mm-broadband-modem-mbim-xmm-fibocom.c',
'fibocom/mm-broadband-modem-mbim-fibocom.c', 'fibocom/mm-broadband-modem-mbim-fibocom.c',
@@ -361,7 +368,7 @@ if plugins_options['fibocom']
endif endif
plugins += {'plugin-fibocom': { plugins += {'plugin-fibocom': {
'plugin': true, 'plugin': true,
'module': {'sources': sources, 'include_directories': plugins_incs + [xmm_inc] + [fibocom_inc], 'c_args': test_udev_rules_dir_c_args + ['-DMM_MODULE_NAME="fibocom"']}, 'module': {'sources': sources, 'include_directories': incs, 'c_args': test_udev_rules_dir_c_args + ['-DMM_MODULE_NAME="fibocom"']},
}} }}
plugins_udev_rules += files('fibocom/77-mm-fibocom-port-types.rules') plugins_udev_rules += files('fibocom/77-mm-fibocom-port-types.rules')