Skip to content
Permalink
Browse files

cmake: Support SDK versions more broadly

The SDK version is of the form X.Y.Z.  Change the cmake scripts to be
based on X.Y of the version.  This allows us to easily support newer
toolchains without having to explicitly add cmake files for the version
as well as removes duplication between those files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
  • Loading branch information...
galak authored and carlescufi committed Aug 2, 2019
1 parent 2b84c72 commit 6228a18d649fde934047eab9c0c8b198be48c8eb

This file was deleted.

This file was deleted.

This file was deleted.

File renamed without changes.
File renamed without changes.
@@ -4,4 +4,4 @@ if (NOT ZEPHYR_SDK_INSTALL_DIR)
message(FATAL_ERROR "ZEPHYR_SDK_INSTALL_DIR must be set")
endif()

include(${ZEPHYR_BASE}/cmake/toolchain/zephyr/${SDK_VERSION}/generic.cmake)
include(${ZEPHYR_BASE}/cmake/toolchain/zephyr/${SDK_MAJOR_MINOR}/generic.cmake)
@@ -34,6 +34,7 @@ file(READ ${sdk_version_path} SDK_VERSION_PRE1)
string(REGEX REPLACE "-.*" "" SDK_VERSION_PRE2 ${SDK_VERSION_PRE1})
# Strip any trailing spaces/newlines from the version string
string(STRIP ${SDK_VERSION_PRE2} SDK_VERSION)
string(REGEX MATCH "([0-9]*).([0-9]*)" SDK_MAJOR_MINOR ${SDK_VERSION})
if(${REQUIRED_SDK_VER} VERSION_GREATER ${SDK_VERSION})
message(FATAL_ERROR "The SDK version you are using is too old, please update your SDK.
You need at least SDK version ${REQUIRED_SDK_VER}.
@@ -43,4 +44,4 @@ https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${REQUIRED_SDK_V
")
endif()

include(${ZEPHYR_BASE}/cmake/toolchain/zephyr/${SDK_VERSION}/host-tools.cmake)
include(${ZEPHYR_BASE}/cmake/toolchain/zephyr/${SDK_MAJOR_MINOR}/host-tools.cmake)
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: Apache-2.0

include(${ZEPHYR_BASE}/cmake/toolchain/zephyr/${SDK_VERSION}/target.cmake)
include(${ZEPHYR_BASE}/cmake/toolchain/zephyr/${SDK_MAJOR_MINOR}/target.cmake)

0 comments on commit 6228a18

Please sign in to comment.
You can’t perform that action at this time.