Fix: mbedtls build error if using prefetched src
mbedtls external component build fails with error:
"Configuration step of Mbed TLS failed with No such file or
directory."
when MBEDTLS_SOURCE_DIR is set to use prefetched source-code.
The error is caused by execute_process() being called with incorrect
parameters making the command depend on the MBEDTLS_BINARY_DIR
existing when the call is made.
Change execute_process() to call cmake with the -B option to set the
build directory instead of relying on the working directory being
correctly set. This way the directory will be created when needed.
Change-Id: Ia2b5fee36e160d381fbf45793152efe2fc873210
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
diff --git a/external/MbedTLS/MbedTLS.cmake b/external/MbedTLS/MbedTLS.cmake
index 16b67d9..ec39e83 100644
--- a/external/MbedTLS/MbedTLS.cmake
+++ b/external/MbedTLS/MbedTLS.cmake
@@ -112,9 +112,8 @@
-DEXTERNAL_DEFINITIONS=-DMBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}"
-DEXTERNAL_INCLUDE_PATHS=${MBEDTLS_EXTRA_INCLUDES}
-GUnix\ Makefiles
- ${MBEDTLS_SOURCE_DIR}
- WORKING_DIRECTORY
- ${MBEDTLS_BINARY_DIR}
+ -S ${MBEDTLS_SOURCE_DIR}
+ -B ${MBEDTLS_BINARY_DIR}
RESULT_VARIABLE _exec_error
)