ESP_PLATFORM flag not set

schnaaabeltier
Posts: 1
Joined: Mon Oct 28, 2019 10:31 am

ESP_PLATFORM flag not set

Postby schnaaabeltier » Mon Oct 28, 2019 10:49 am

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!

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ESP_PLATFORM flag not set

Postby ESP_Angus » Mon Oct 28, 2019 10:55 pm

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

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP_PLATFORM flag not set

Postby WiFive » Mon Oct 28, 2019 11:59 pm


Who is online

Users browsing this forum: Bing [Bot], ok-home and 105 guests