Commit 61044303 authored by Keith Packard's avatar Keith Packard Committed by Stephanos Ioannidis
Browse files

cmake: Support both toolchain directory layouts

Until https://github.com/zephyrproject-rtos/sdk-ng/pull/936

 is merged,
SDK 0.18 is incompatible with previous versions as the paths to
find the cmake bits is different.

Deal with that by checking for files in the wrong place as well as the
right one.

Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent a9e745f7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2,7 +2,11 @@

if(TOOLCHAIN_VARIANT_COMPILER STREQUAL "gnu" OR
    NOT DEFINED TOOLCHAIN_VARIANT_COMPILER)
  if(EXISTS ${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/gnu/generic.cmake)
    include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/gnu/generic.cmake)
  else()
    include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/generic.cmake)
  endif()
  set(TOOLCHAIN_VARIANT_COMPILER "gnu" CACHE STRING "compiler used by the toolchain variant" FORCE)

  set(TOOLCHAIN_KCONFIG_DIR ${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr)
+5 −1
Original line number Diff line number Diff line
@@ -3,7 +3,11 @@
if(TOOLCHAIN_VARIANT_COMPILER STREQUAL "gnu" OR
   TOOLCHAIN_VARIANT_COMPILER STREQUAL "default")
  set(TOOLCHAIN_VARIANT_COMPILER gnu CACHE STRING "Variant compiler being used")
  if(EXISTS ${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/gnu/target.cmake)
    include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/gnu/target.cmake)
  else()
    include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/target.cmake)
  endif()
elseif (TOOLCHAIN_VARIANT_COMPILER STREQUAL "llvm")
  set(TOOLCHAIN_VARIANT_COMPILER llvm CACHE STRING "Variant compiler being used")
  include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/llvm/target.cmake)