## 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

1. Select the launch configurion of the project you want to build.

2. Select launch mode Run.

3. Press the Build button in the launch bar.

4. Inspect the build output in the Console window.

5. Find the build results in the Project Explorer.

### Building for Debug

To build for Debug:

1. Select the launch configurion of the project you want to build.

2. Select launch mode Debug.

3. Press the Build button.

4. Inspect the build output in the Console window.

5. 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:

1. Set the launch mode to Run

2. 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

Next: Running a project

Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation