Test PSA compliance: Build only the crypto target

Use CMake's -t option to build only the crypto target. Parameterize the
crypto target to have the right name depending on whether this is Mbed
TLS or PSA Crypto.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann 2023-08-29 13:56:17 +01:00
parent c69074dcf6
commit beaee2604f

@ -62,10 +62,15 @@ def main(library_build_dir: str):
in_psa_crypto_repo = build_tree.looks_like_psa_crypto_root(root_dir) in_psa_crypto_repo = build_tree.looks_like_psa_crypto_root(root_dir)
if in_psa_crypto_repo: if in_psa_crypto_repo:
crypto_lib_filename = \ crypto_name = 'psacrypto'
library_build_dir + '/core/libpsacrypto.a' library_subdir = 'core'
else: else:
crypto_lib_filename = library_build_dir + '/library/libmbedcrypto.a' crypto_name = 'mbedcrypto'
library_subdir = 'library'
crypto_lib_filename = (library_build_dir + '/' +
library_subdir + '/' +
'lib' + crypto_name + '.a')
if not os.path.exists(crypto_lib_filename): if not os.path.exists(crypto_lib_filename):
#pylint: disable=bad-continuation #pylint: disable=bad-continuation
@ -74,7 +79,8 @@ def main(library_build_dir: str):
'-GUnix Makefiles', '-GUnix Makefiles',
'-B', library_build_dir '-B', library_build_dir
]) ])
subprocess.check_call(['cmake', '--build', library_build_dir]) subprocess.check_call(['cmake', '--build', library_build_dir,
'-t', crypto_name])
psa_arch_tests_dir = 'psa-arch-tests' psa_arch_tests_dir = 'psa-arch-tests'
os.makedirs(psa_arch_tests_dir, exist_ok=True) os.makedirs(psa_arch_tests_dir, exist_ok=True)