<commit_before>---
layout: documentation
title: Common C++ Build Use Cases
---

# Common C++ Build Use Cases

Here you will find some of the most common use cases for building C++ projects
with Bazel. If you have not done so already, get started with building C++
projects with Bazel by completing the tutorial
[Introduction to Bazel: Build a C++ Project](tutorial/cpp.html).

For information on cc_library and hdrs header files, see
<a href="be/c-cpp.html#cc_library">cc_library</a>.

## Including multiple files in a target

You can include multiple files in a single target with
[glob](../be/functions.html#glob).
For example:

```python
cc_library(
    name = "build-all-the-files",
    srcs = glob(["*.cc"]),
    hdrs = glob(["*.h"]),
)
```
<commit_msg>Fix link to glob<commit_after>---
layout: documentation
title: Common C++ Build Use Cases
---

# Common C++ Build Use Cases

Here you will find some of the most common use cases for building C++ projects
with Bazel. If you have not done so already, get started with building C++
projects with Bazel by completing the tutorial
[Introduction to Bazel: Build a C++ Project](tutorial/cpp.html).

For information on cc_library and hdrs header files, see
<a href="be/c-cpp.html#cc_library">cc_library</a>.

## Including multiple files in a target

You can include multiple files in a single target with
<a href="be/functions.html#glob">glob</a>.
For example:

```python
cc_library(
    name = "build-all-the-files",
    srcs = glob(["*.cc"]),
    hdrs = glob(["*.h"]),
)
```

{'fraction_non_alphanumeric': 0.12508185985592665, 'fraction_numerical': 0.0, 'mean_word_length': 4.1447811447811445, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7558514', 'n_tokens_mistral': 482, 'n_tokens_neox': 469, 'n_words': 194}