Code: Select all
component_dir/
examples/
.vscode/
main/
example_source_code.c
CMakeLists.txt
CMakeLists.txt (project)
component_source.c
CMakeLists.txt
idf_component.yml
test/
component_source_test.c
CMakeLists.txt
test_runner/
test_runner.c
CMakeLists.txt (project)
In vscode I create a workspace file with the following:
Code: Select all
{
"folders": [
{
"path": "./examples"
},
{
"path": "./test_runner"
},
{
"path": "."
},
],
}
There doesn't seem to be a way to tell esp-idf that I wish to perform a build in ./test_runner which seems really odd (or more likely I'm missing something)
So the question is, how to I tell IDF that I have multiple projects (subfolders) and I wish to build a specific one (or potentially a group of them, not "." because that contains no CMakeLists.txt project file and must be included in a real project that uses that component).
I've looked at the on-line documentation(1), and the ESP-IDF Project Configuration option but while that can specify a build directory it doesn't have anything to say which project folder is to be used as the project.
(1) https://github.com/espressif/vscode-esp ... ROJECTS.md which seems to outline what I have already done, but still doesn't tell me what I need to do to make the vscode extension select the project I wish to compile.
I can work on the component code itself (within the ".") because when it compiles the /examples code it pulls in the code from there... but I have to go to the command line if I wish to compile the test_runner code which also pulls in the "." code and the "test/" code which is not specifically added to the workspace file (I can drill down to it via the ".").
I have tried adding a .vscode/ and files to both examples/ and test_runner/ but that doesn't seem to do anything.
I also had to put "C_Cpp.default.compileCommands": "${workspaceFolder:examples}/build/compile_commands.json", into the user level settings.json (Note the :examples) otherwise code in "." would syntax error because obviously the build files were in /examples/build/
Any help would be much appreciated, even if its to say that its not currently possible and that I'll have to use the command line.