Page 1 of 1

ESP_PLATFORM flag not set

Posted: Mon Oct 28, 2019 10:49 am
by schnaaabeltier
Hi,

I am trying to build my application for different targets which sometimes require different CMake commands. So I did the following:

1. Clone the esp-idf-template application from Github.
2. Create an empty component named test_component.
3. Change the CMakeLists.txt in test_component so it looks like the following:

Code: Select all

if(ESP_PLATFORM)
    message("Building with esp-idf...")
    idf_component_register(
            SRCS
                "component.cpp"
            INCLUDE_DIRS
                "."
    )
else()
    message("Not building with esp-idf...")
    # do some stuff for other platforms
endif()
When I run idf.py build from the projects root directory, the ESP_PLATFORM variable seems not to be set, but I would expect it to be set according to the docs: https://docs.espressif.com/projects/esp ... components . Do I need to configure anything differently or build the project in another way?

Thank you in advance!

Re: ESP_PLATFORM flag not set

Posted: Mon Oct 28, 2019 10:55 pm
by ESP_Angus
Hi schnaaabeltier,

What ESP-IDF version do you have? This was a bug in v4.0-beta1, but it's been fixed and you can get the fix by checking out the latest release/v4.0 branch. There will be a v4.0-beta2 prerelease soon.

Angus

Re: ESP_PLATFORM flag not set

Posted: Mon Oct 28, 2019 11:59 pm
by WiFive