I having a ESP-IDF project on a Windows 11 PC,,, running VsCode and ESP-IDF
For different reasons I decided to try out remote development using VsCode devcontainer.
Setting up everything was a smooth process. Only problem I had was that Linus is case sensitive on filenames so I needed to change some file name references in my source code.
But,, always a but
In my CMakeList.txt files I use this kind of constructs to pass in environment variables:
Code: Select all
idf_build_set_property(COMPILE_OPTIONS "-DTEST_WIFI_SSID=$ENV{TEST_WIFI_SSID}" APPEND)
I created a "test" to show this,,,, by adding a line in my main.cpp.
Code: Select all
ESP_LOGI("c_MAIN", "Creating app %s", TEST_WIFI_SSID);
In windows this will not happen./workspaces/mdcb/main/app_main.cpp: In function 'void app_main()': /workspaces/mdcb/main/app_main.cpp:25:38: error: 'TEST_WIFI_SSID' was not declared in this scope 25 | ESP_LOGI("c_MAIN", "Creating app %s",TEST_WIFI_SSID);
To be sure that cmake have access to the environment variable, I added a printout in CMakeList.txt
message(STATUS "##################COMPILING FOR WIFI : " "$ENV{TEST_WIFI_SSID}")
This works showing that cmake have access to the environment variable.
I can see in the q++ output that the variable is not transferred to the compiler,, -DTEST_WIFI_SSID is missing.
So,, my conclusion is that "idf_build_set_property" differs between Windows 11 and Linux(devcontainer).
Can anyone confirm/deny suggest fix,,,???