Introduce function to return library/core directory
Add crypto_core_directory in build_tree.py so that
the libary/core directory can be returned based
on what repository we are in.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
diff --git a/scripts/mbedtls_dev/build_tree.py b/scripts/mbedtls_dev/build_tree.py
index a657a51..4a42d9a 100644
--- a/scripts/mbedtls_dev/build_tree.py
+++ b/scripts/mbedtls_dev/build_tree.py
@@ -21,6 +21,14 @@
def looks_like_root(path: str) -> bool:
return looks_like_tf_psa_crypto_root(path) or looks_like_mbedtls_root(path)
+def crypto_core_directory() -> str:
+ if looks_like_tf_psa_crypto_root(os.path.curdir):
+ return "core"
+ elif looks_like_mbedtls_root(os.path.curdir):
+ return "library"
+ else:
+ raise Exception('Neither Mbed TLS nor TF-PSA-Crypto source tree found')
+
def check_repo_path():
"""
Check that the current working directory is the project root, and throw