build: standardize component names and defines
[dpdk.git] / drivers / common / qat / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017-2018 Intel Corporation
3
4 config_flag_fmt = 'RTE_LIBRTE_@0@_COMMON'
5
6 qat_crypto = true
7 qat_crypto_path = 'crypto/qat'
8 qat_crypto_relpath = '../../' + qat_crypto_path
9 qat_compress = true
10 qat_compress_path = 'compress/qat'
11 qat_compress_relpath = '../../' + qat_compress_path
12
13 if disabled_drivers.contains(qat_crypto_path)
14         qat_crypto = false
15         dpdk_drvs_disabled += qat_crypto_path
16         set_variable(qat_crypto_path.underscorify() + '_disable_reason',
17                         'Explicitly disabled via build config')
18 endif
19 if disabled_drivers.contains(qat_compress_path)
20         qat_compress = false
21         dpdk_drvs_disabled += qat_compress_path
22         set_variable(qat_compress_path.underscorify() + '_disable_reason',
23                         'Explicitly disabled via build config')
24 endif
25
26 libcrypto = dependency('libcrypto', required: false)
27 if qat_crypto and not libcrypto.found()
28         qat_crypto = false
29         dpdk_drvs_disabled += qat_crypto_path
30         set_variable(qat_crypto_path.underscorify() + '_disable_reason',
31                         'missing dependency, libcrypto')
32 endif
33
34 # The driver should not build if both compression and crypto are disabled
35 #FIXME common code depends on compression files so check only compress!
36 if not qat_compress # and not qat_crypto
37         build = false
38         reason = '' # rely on reason for compress/crypto above
39         subdir_done()
40 endif
41
42 deps += ['bus_pci', 'cryptodev', 'net', 'compressdev']
43 sources += files('qat_common.c',
44                 'qat_qp.c',
45                 'qat_device.c',
46                 'qat_logs.c')
47 includes += include_directories('qat_adf',
48                 qat_crypto_relpath,
49                 qat_compress_relpath)
50
51 if qat_compress
52         foreach f: ['qat_comp_pmd.c', 'qat_comp.c']
53                 sources += files(join_paths(qat_compress_relpath, f))
54         endforeach
55 endif
56
57 if qat_crypto
58         foreach f: ['qat_sym_pmd.c', 'qat_sym.c', 'qat_sym_session.c',
59                         'qat_sym_hw_dp.c', 'qat_asym_pmd.c', 'qat_asym.c']
60                 sources += files(join_paths(qat_crypto_relpath, f))
61         endforeach
62         deps += ['security']
63         ext_deps += libcrypto
64         cflags += ['-DBUILD_QAT_SYM', '-DBUILD_QAT_ASYM']
65 endif