sdkconfig.defaults for different versions of IDF
Posted: Fri Jun 16, 2023 10:22 am
Hi.
I know build system supports multiple 'sdkconfig.defaults' files. Each target can have its sdkconfig.defaults file.
But is there a proper way to manage`sdkconfig.defaults` for different versions of ESP-IDF?
I came up with something like this:
It is somehow working but build system documentation says all set commands must be after 'cmake_minimum_required' and before 'include()'.
Can I use this? or it is a bug and it would fix later?
I know build system supports multiple 'sdkconfig.defaults' files. Each target can have its sdkconfig.defaults file.
But is there a proper way to manage`sdkconfig.defaults` for different versions of ESP-IDF?
I came up with something like this:
Code: Select all
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(SDKCONFIG "${CMAKE_BINARY_DIR}/sdkconfig")
set(SDKCONFIG_DEFAULTS "sdkconfig.defaults")
if(IDF_VERSION_MAJOR EQUAL 5)
list(APPEND SDKCONFIG_DEFAULTS "sdkconfig.defaults.v5")
elseif(IDF_VERSION_MAJOR EQUAL 4)
list(APPEND SDKCONFIG_DEFAULTS "sdkconfig.defaults.v4")
endif()
project(Playground)
Can I use this? or it is a bug and it would fix later?