Excluding sources from the active build configuration - iarsystems/ewptool GitHub Wiki

Consider the following project:

┏ 📂 Project
┃ ┣ 📂 3rd-party-components
┃ ┃ ┣ 📂 array
┃ ┃ ┣ 📂 buffer
┃ ┃ ┃ ┣ 📄 buffer_typeA.c
┃ ┃ ┃ ┣ 📄 buffer_typeB.c
┃ ┃ ┃ ┗ 📄 buffer_typeC.c
┃ ┃ ┗ 📄 ring.c
┃ ┣ 📂 debug
...

For this fictitious example, the buffer component is supplied with 3 different implementations (buffer_type?.c) with different trade-offs whereas only one should be chosen at a time.

Let's say that you decide that the project needs buffer_typeA.c. Being so, buffer_typeB.c and buffer_typeC.c must be excluded from the current build configuration.

There are at least a couple of ways of accomplish this in the Workspace window:

  • Remove the undesired files from the project layout:

    • Highlight each of the undesired file nodes (buffer_typeB.c and buffer_typeC.c).
    • Remove them from the project layout by pressing the DEL key. or...
  • Exclude the undesired files from the build:

    • For each of the undesired file nodes: right-click and select: OptionsExclude from build. or...
  • Create an "excluded" group:

    • Create a new group (i.e. excluded) inside the desired group.
    • Right-click on the excluded group and select: OptionsExclude from build.
    • While holding SHIFT, select multiple files (i.e. click on buffer_typeB.c followed by buffer_typeC.c).
    • Finally drag the selection and drop these files inside the excluded group. By consequence, they will be excluded from the current build configuration (the example depicts "Debug").

project-exclude-group

⚠️ Notice that when a group or a file is excluded from build, its icon becomes grayed.

⚠️ Excluding sources from the current build configuration does not propagate to other build configurations.

💡 Once the layout was customized, save the project by choosing FileSave All. Alternatively, click the Save All icon in the Main toolbar.

ide-save-all

⚠️ **GitHub.com Fallback** ⚠️