This extension adds support for bake based C++ projects to VS Code.
Bake is a build tool for C++ projects supporting:
- multiple modules (library, executable)
- multiple targets
- Import C/C++ Include paths and Defines into VS Code
- Create new .h and .cpp files based on templates (from explorer's context menu)
- Search for and execute targets from bake files (from Tasks: Run Task command)
Manage C++ Includes and Defines
VS Code's C++ integration requires a list of include paths and
defines of your workspace. These need to be confiured at
.vscode/c_cpp_properties.json. The bake extension can assist
you with keeping the
c_cpp_properties.json inline with your
From the command palette
- Import C++ Includes and Defines from Bake
- Clean imported C++ Includes and Defines from Bake
Import C++ Includes and Defines from Bake
A bake workspace typically contains multiple bake projects. Each project is
defined by a
Project.meta file. Typically projects depend on other projects. To import the C++ Includes and Defines, you need to select
a project and build-config to build the dependency tree from.
There are two ways on how to select a project/config combination.
Optional: there are pre-defined combinations at your
combinations are called build variants. They may include an optional
parameter, too. If a build variant is marked as
default=true is is automatically imported during opening of the workspace.
Let VS Code search for
Project.meta files in your workspace. Then you can select the project and the build-config afterwards.
Create new .h/.cpp files
The bake extension can assist you in creating new
*.cpp files. The files are then pre-filled with copyright informations, namespace definitions (derived from the folder name) and an empty class definition.
To create a new file: Select a folder at the Explorer panel and open the context menu (right mouse click).
You can customize the templates used to fill the files here:
This extension contributes the following settings:
bake.parallelBuildNum: Number of processes used for parallel bake builds (-j parameter). Global setting that defaults to
bake.unitTestsAdapt: Adapt for setting used compiler in unit test builds. Global setting that defaults to
bake.runUnitTestsOnBuild: Boolean whether unit tests shall be run after a successfull unit test build. Global setting that defaults to
bake.defaultPromblemMatcher: Used problem finder in the output during builds. Default to
$gcc. Can be overwritten per task in task configuration.
bake.buildVariants: optional setting to define build variants to retrieve includes/defines from. A buildVariant is defined by a project (bake's -m flag) and a build config. Here is an example configuration for embedded development:
Deprecated (the following settings are now ignored):
bake.mainProject: override the path to the main project (bake's -m flag). Default is
bake.targetConfig: override the name of the target config
If anything behaves unexpected check the bake tab in the output window.
- Florian Bramer
- Troels Frimor
- Re-introduced possibility to pre-define build variants in settings
- Bake adapts (--adapt) are now supported for pre-defined variants
- Pre-defined build variant marked as "default" is automatically imported after each VS Code startup
- Build variants defined in settings and variants found dynamically (through searching Project.meta files) can now co-exist
- Bake tasks are derived from last selected build variant
- More logging and better error messages
- Cleaned up code base
- Register bake targets as build targets with the taskProvider
- Searches entire workspace for targets for setting include paths or build
- Introduced search for Project.meta files to configure workspace with
- introduced feature to create .h .cpp files based from templates
- introduced support for multiple build variants (combinations of project and config)
second alpha release, supports:
- import of defines on linux only
initial alpha release, supports:
- import of include paths on linux only
- first try to publish an extension