Commit graph

10 commits

Author SHA1 Message Date
Torsten Rasmussen b557bd90a6 cmake: Zephyr sdk backward compatibility with 0.11.1 and 0.11.2
This commit introduces backward compatibility with Zephyr SDK 0.11.1
and 0.11.2 so that users having one of those versions installed can
continue to use that version.

This remove the need to force users to update their SDK.

This is kept in independent commit to ensure it can easily be reverted
when minimum required Zephyr SDK is bumped to version 0.12.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-08 17:15:55 +02:00
Torsten Rasmussen 299a154fdd cmake: Zephyr sdk package handling
This commit introduces Zephyr SDK CMake config package.

This removes the need for setting ZEPHYR_SDK_INSTALL_DIR and
ZEPHYR_TOOLCHAIN_VARIANT when using Zephyr SDK in Linux.
It also allows to introduces never SDKs without breaking Zephyr.

For example, with this PR, the current Zephyr SDK is 0.11.1 but when
releasing 0.12 then the current Zephyr will no longer built.
This PR moves the Zephyr SDK CMake related code to the SDK and thus
allowing to use newer SDKs, as long as they are backwards compatible.

It also allows multiple SDK installations, and will automatically select
the version closet to the required version.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-08 17:15:55 +02:00
Martí Bolívar c5f8e9a84b cmake: toolchain: print what we find
Print the name of the discovered toolchain as well as the variable
used to initialize it.

This is nice to know when doing remote support, since users will
sometimes misconfigure their toolchain and not know what that means.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-10 14:53:28 +02:00
Kumar Gala 2630fbaa75 cmake: Introduce optional Kconfig for toolchains
Allow a given toolchain to specify Kconfig options that might be
relevant to a feature available in that toolchain.

For example, the ARM embedded GNU toolchain supports two variants of
newlib and you select the smaller one via a spec file.  We can use a
Kconfig option like HAS_NEWLIB_LIBC_NANO to convey that this feature is
supported by that toolchain.

We look for the toolchain Kconfig in ${TOOLCHAIN_KCONFIG_DIR}/Kconfig,
and default TOOLCHAIN_KCONFIG_DIR to:

${TOOLCHAIN_ROOT}/cmake/toolchain/${ZEPHYR_TOOLCHAIN_VARIANT})

toolchain specific cmake files can override the default if needed.

Additionally tweaked the zephyr/generic.cmake to use
${CMAKE_CURRENT_LIST_DIR} to reduce some duplication.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-01-29 12:22:31 -06:00
Kumar Gala 6228a18d64 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>
2019-08-05 12:16:12 +02:00
Vinayak Kariappa Chettimada a1e25b91ff cmake: check ZEPHYR_SDK_INSTALL_DIR is set
Check for ZEPHYR_SDK_INSTALL_DIR being invalid instead of
checking for SDK_VERSION being not defined. This change
relates to commit bb09c458c1 ("cmake: Prevent infinite
recursion").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-07-04 09:24:57 -04:00
Jacob Siverskog bb09c458c1 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 <jacob@teenage.engineering>
2019-04-18 09:23:46 -04:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Anas Nashif 114a1154ef toolchain: Support multiple versions of the Zephyr SDK
Depending on the installed and enabled SDK, we now load the right
configuration allowing people to migrate gracefully to the new SDK.

The selection is done based on the version of the SDK. Minimal required
SDK is still kept as 0.9.5.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 10:51:14 -06:00
Sebastian Bøe a0a63ac344 cmake: Split toolchain configuration into pre-and post-DT
Split up the toolchain configuration into two phases, generic and
target. The 'generic' phase configures the toolchain just enough to be
able to preprocess DT files. The 'target' phase completes the
configuration with target-specific configuration.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-12-14 13:16:28 +01:00