CMake: Fix error that prevented re-build

Promote MBED_TOOLCHAIN_FILE_USED to cache variable so
its previous state can be recalled when re-building. This
is because CMAKE_TOOLCHAIN_FILE is also a cache variable and its
value is set on first run when it has not been set.
pull/13895/head
Hugues Kamba 2020-11-10 17:42:40 +00:00
parent 6068428209
commit a70edcda0a
1 changed files with 2 additions and 4 deletions

View File

@ -9,11 +9,9 @@ endif()
include(${MBED_CONFIG_PATH}/mbed_config.cmake)
set(MBED_TOOLCHAIN_FILE_USED FALSE)
# Set default toolchain file
if(NOT CMAKE_TOOLCHAIN_FILE)
set(MBED_TOOLCHAIN_FILE_USED TRUE)
if(NOT CMAKE_TOOLCHAIN_FILE OR MBED_TOOLCHAIN_FILE_USED)
set(MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "")
set(CMAKE_TOOLCHAIN_FILE "${MBED_PATH}/tools/cmake/toolchain.cmake" CACHE INTERNAL "")