toolchain: cmake: Off-tree toolchains gets other.h included if selected
To ensure that an off-tree toolchain gets the toolchain/other.h header included, such that it can include the correct header for the toolchain via the other.h, the define __TOOLCHAIN_CUSTOM__ will be set when ever the cmake flag TOOLCHAIN_USE_CUSTOM is set. An off-tree toolchain needs to set the set(TOOLCHAIN_USE_CUSTOM 1) in the off-tree generic.cmake and/or target.cmake, in order for the include/other.h to be included. The generic.cmake and target.cmake will be under ${TOOLCHAIN_ROOT}/cmake/toolchain/${ZEPHYR_TOOLCHAIN_VARIANT}/ As the TOOLCHAIN_USE_CUSTOM is only set for off-tree toolchains, this has no impact on in-tree toolchains and their functionality. Fixes zephyrproject-rtos#36117 Signed-off-by: Danny Oerndrup <daor@demant.com>
This commit is contained in:
parent
51f2022f7b
commit
94202f3ed7
2 changed files with 12 additions and 5 deletions
|
@ -33,7 +33,12 @@
|
|||
#define HAS_BUILTIN(x) HAS_BUILTIN_##x
|
||||
#endif
|
||||
|
||||
#if defined(__XCC__)
|
||||
#if defined(__TOOLCHAIN_CUSTOM__)
|
||||
/* This include line exists for off-tree definitions of compilers,
|
||||
* and therefore this header is not meant to exist in-tree
|
||||
*/
|
||||
#include <toolchain/other.h>
|
||||
#elif defined(__XCC__)
|
||||
#include <toolchain/xcc.h>
|
||||
#elif defined(__CCAC__)
|
||||
#include <toolchain/mwdt.h>
|
||||
|
@ -42,10 +47,7 @@
|
|||
#elif defined(__GNUC__) || (defined(_LINKER) && defined(__GCC_LINKER_CMD__))
|
||||
#include <toolchain/gcc.h>
|
||||
#else
|
||||
/* This include line exists for off-tree definitions of compilers,
|
||||
* and therefore this header is not meant to exist in-tree
|
||||
*/
|
||||
#include <toolchain/other.h>
|
||||
#error "Invalid/unknown toolchain configuration"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue