On Fri, May 16, 2025 at 10:19 AM, Alexander Kanavin wrote:
Can you put —features directly into packageconfig definitions? Does cargo accept multiple —features flags?
Oh, yes it works. Thanks. The only small problem is I can't use comma-separated features in PACKAGECONFIG because it itself is comma-separated. So I have to add --features before each feature in the same line. It doesn't look bad if I use -F instead of --features though:
PACKAGECONFIG ??= "PKCS11 MBED-CRYPTO"
have_TPM = "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', 'TPM', '', d)}"
PACKAGECONFIG:append = " ${@bb.utils.contains('BBFILE_COLLECTIONS', 'tpm-layer', '${have_TPM}', '', d)}"
PACKAGECONFIG[ALL] = "-F all-providers -F cryptoki/generate-bindings -F tss-esapi/generate-bindings,,tpm2-tss libts,tpm2-tss libtss2-tcti-device libts"
PACKAGECONFIG[TPM] = "-F tpm-provider -F tss-esapi/generate-bindings,,tpm2-tss,tpm2-tss libtss2-tcti-device"
PACKAGECONFIG[PKCS11] = "-F pkcs11-provider -F cryptoki/generate-bindings,"
PACKAGECONFIG[MBED-CRYPTO] = "-F mbed-crypto-provider,"
PACKAGECONFIG[CRYPTOAUTHLIB] = "-F cryptoauthlib-provider,"
PACKAGECONFIG[TS] = "-F trusted-service-provider,,libts,libts"
Anton