if the project was already configured, IDF_TOOLCHAIN=clang environment variable has no effect, since it is cached in CMakeCache.txt. So the project will continue using a GCC toolchain even after idf.py reconfigure
if the project hasn't been configured yet, IDF_TOOLCHAIN=clang will get recognized and Clang toolchain will be used; however if later the user runs idf.py build, Clang toolchain will also be used for the build. This might be unexpected, since the behavior (the toolchain used) will be different depending on whether the user did run idf.py clang-check or not.
I think the cleaner solution would be to ignore the args.build_dir and always run a CMake configuration stage from scratch in a temporary directory. There is a downside that this will be slower, though.
Draft implementation of #8.
The issues with this are:
idf.py reconfigure
idf.py build
, Clang toolchain will also be used for the build. This might be unexpected, since the behavior (the toolchain used) will be different depending on whether the user did runidf.py clang-check
or not.I think the cleaner solution would be to ignore the args.build_dir and always run a CMake configuration stage from scratch in a temporary directory. There is a downside that this will be slower, though.