From bb09c458c18f452a024ddb07a5754f5829454341 Mon Sep 17 00:00:00 2001 From: Jacob Siverskog Date: Mon, 1 Apr 2019 12:08:26 +0200 Subject: [PATCH] cmake: Prevent infinite recursion If SDK_VERSION for whatever reason is unset cmake will end up in an inifite recursion loop, which for me crashed using cmake version 3.13.4 and exits with an error using 3.14.1. This may happen if ZEPHYR_TOOLCHAIN_VARIANT is set to "zephyr", but ZEPHYR_SDK_INSTALL_DIR is invalid (or unset). Signed-off-by: Jacob Siverskog --- cmake/toolchain/zephyr/generic.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/toolchain/zephyr/generic.cmake b/cmake/toolchain/zephyr/generic.cmake index 1db98b3d9e2..b8496614a69 100644 --- a/cmake/toolchain/zephyr/generic.cmake +++ b/cmake/toolchain/zephyr/generic.cmake @@ -1,3 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 +if(NOT DEFINED SDK_VERSION) + message(FATAL_ERROR "SDK_VERSION must be set") +endif() + include(${ZEPHYR_BASE}/cmake/toolchain/zephyr/${SDK_VERSION}/generic.cmake)