ESP IDF V5.1.1 Project Configuration Problem
Posted: Tue Nov 07, 2023 5:57 pm
In my top level CMakeLists.txt file, I've added this statement to top of it
I've a component under components folder and I'm trying to read COMPILE_DEFINITIONS in that components CMakeLists.txt file as below
When I call idf.py reconfigure or idf.py build, I've observed an interesting behaviour. The log is as below
As you can see it's running it twice and on the first run it fails to read compile definitions and prints empty output. This causes compiler errors on my projects because when I try to build, the failure on the first call affects my build.
How can I solve this problem?
Thanks in advance!
Code: Select all
add_compile_definitions(PROJECT_TYPE_A)
get_directory_property( DirDefs COMPILE_DEFINITIONS )
message( "COMPILE_DEFINITIONS TOP LEVEL = ${DirDefs}" )
Code: Select all
get_directory_property( DirDefs COMPILE_DEFINITIONS )
message(STATUS "COMPILE_DEFINITIONS COMPONENT LEVEL = ${DirDefs}" )
Code: Select all
COMPILE_DEFINITIONS TOP LEVEL = PROJECT_TYPE_A
Some Logs
....
-- ccache will be used for faster recompilation
-- Building ESP-IDF components for target esp32
-- COMPILE_DEFINITIONS COMPONENT LEVEL =
....
More Logs
-- App "<PROJECT_NAME>" version: xxxxxx-dirty
-- Adding linker script <xxxxxxxxxx>
-- Adding linker script <xxxxxxxxxx>
-- Adding linker script <xxxxxxxxxx>
-- Adding linker script <xxxxxxxxxx>
-- COMPILE_DEFINITIONS COMPONENT LEVEL = PROJECT_TYPE_A
How can I solve this problem?
Thanks in advance!