From e3fa3a4e574ed987efdc81391e2db5729d2700ad Mon Sep 17 00:00:00 2001 From: Harry Ramsey Date: Mon, 9 Dec 2024 20:08:09 +0000 Subject: [PATCH 1/2] Fix incorrect submodule error message in CMake This commit fixes a condition where the incorrect submodule error message was displayed as we were using the CMAKE_CURRENT_SOURCE_DIR variable instead of MBEDTLS_DIR. Signed-off-by: Harry Ramsey --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1501240662..5235910cf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,7 +351,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Check" AND TEST_CPP) endif() if (NOT EXISTS "${MBEDTLS_FRAMEWORK_DIR}/CMakeLists.txt") - if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/") + if (EXISTS "${MBEDTLS_DIR}/.git") message(FATAL_ERROR "${MBEDTLS_FRAMEWORK_DIR}/CMakeLists.txt not found (and does appear to be a git checkout). Run `git submodule update --init` from the source tree to fetch the submodule contents.") else () message(FATAL_ERROR "${MBEDTLS_FRAMEWORK_DIR}/CMakeLists.txt not found (and does not appear to be a git checkout). Please ensure you have downloaded the right archive from the release page on GitHub.") From 5d5f4715dd215b01c033fb7e185059056f249b21 Mon Sep 17 00:00:00 2001 From: Harry Ramsey Date: Tue, 10 Dec 2024 09:58:23 +0000 Subject: [PATCH 2/2] Fix incorrect submodule error message in Makefile This commit fixes a condition where the incorrect submodule error message was displayed as the check for the directory returns true only if the directory does not exist Signed-off-by: Harry Ramsey --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ebe8492fc2..2e4df67ede 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ ifneq (,$(filter-out lib library/%,$(or $(MAKECMDGOALS),all))) ifeq (,$(wildcard framework/exported.make)) # Use the define keyword to get a multi-line message. # GNU make appends ". Stop.", so tweak the ending of our message accordingly. - ifeq (,$(wildcard .git)) + ifneq (,$(wildcard .git)) define error_message ${MBEDTLS_PATH}/framework/exported.make not found (and does appear to be a git checkout). Run `git submodule update --init` from the source tree to fetch the submodule contents. This is a fatal error