I'm trying to set some C++ flags for all the components I'm using.
I've succeeded by adding set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSOMEFLAG") to the CMakeLists.txt in the main folder. This compiles perfectly and all components see the define SOMEFLAG. Idf.py --version outputs: ESP-IDF v4.3.1.
Now it gets interesting. When I compile the exact same code in the esp-idf docker container the build fails because the defines are not found in the other components. If I run Idf.py --version here it outputs: ESP-IDF v4.3.1-dirty.
What could cause this? How can I add defines so that they would also be found by the components in the docker container?
Thanks in advance!
Carlos
Difference between platforms in global ${CMAKE_CXX_FLAGS} defintion.
Re: Difference between platforms in global ${CMAKE_CXX_FLAGS} defintion.
I can now reproduce it on both platforms. The questions which remains is how should I declare flags that should go to every component?
Re: Difference between platforms in global ${CMAKE_CXX_FLAGS} defintion.
The build system in ESP-IDF isn't vanilla CMake as there are a lot of feature that are wrapped on top and exposed as commands and properties.
Try the idf_build_set_property() command where you target the CXX_COMPILER_OPTIONS property with an append option.
Try the idf_build_set_property() command where you target the CXX_COMPILER_OPTIONS property with an append option.
Who is online
Users browsing this forum: Google [Bot] and 270 guests