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.
- Use idf_build_set_property() at the project level to set properties at the project level (e.g., apply compiler flags across the entire project).
- To target the compiler options of a particular component, try target_compile_options() inside the component's CMakeLists.txt
Who is online
Users browsing this forum: No registered users and 121 guests