Building a project
During Core Build System (CBS) project creation a launch configuration with the same name is created along with it. The Build settings are managed in the Build Settings tab of the launch configuration.
CBS projects rely on the Launch Bar. Make sure the launch bar is installed and enabled.
Building for Run
-
Select the launch configurion of the project you want to build.
-
Select launch mode Run.
-
Press the Build button in the launch bar.
-
Inspect the build output in the Console window.
-
Find the build results in the Project Explorer.
Building for Debug
To build for Debug:
-
Select the launch configurion of the project you want to build.
-
Select launch mode Debug.
-
Press the Build button.
-
Inspect the build output in the Console window.
-
Find the build results in the Project Explorer.
Changing build settings
The launch configuration presents separate build settings for launch mode Run and Debug. You will see the build settings depending on the selected launch mode.
To change Run build settings:
-
Set the launch mode to Run
-
Edit the project’s launch configuration. Click on the gear icon.
The edit launch configuration wizard will open. Select the Build Settings tab.
The only settings that can be changed are the build chain, and how CMake or Make is called. There are no options to set pre-processor symbols or include paths. This makes that the project can easily be shared with other IDEs, command line, or continuous integration flows.
The following picture shows the build settings of a CMake project.
Makefile projects BUILD_MODE
For CBS Makefile projects the launch mode is passed to make
via
environment variable BUILD_MODE
. In the Makefile you can make use of
this variable to set the wanted CFLAGS
per launch mode.
Launch mode | BUILD_MODE |
---|---|
Run |
run |
Debug |
debug |
Here is some example code that makes use of BUILD_MODE
to set the
wanted CFLAGS
:
ifeq ($(BUILD_MODE),debug)
CFLAGS += -g -O0
else ifeq ($(BUILD_MODE),run)
CFLAGS += -O2
endif