# the -x c++ flag

**URL:** https://discourse.cmake.org/t/the-x-c-flag/6043
**Category:** Usage
**Created:** [July 11, 2022, 12:16pm UTC](https://discourse.cmake.org/t/the-x-c-flag/6043 "2022-07-11T12:16:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MKR](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mkr/32/2575_2.png) [@MKR](https://discourse.cmake.org/u/MKR)
#### Post date: [July 11, 2022, 12:16pm UTC](https://discourse.cmake.org/t/the-x-c-flag/6043/1 "2022-07-11T12:16:33Z")

</div>

How can I pass the -x c++ flag to the compiler (clang++/g++) with cMake?

---

<div class="post-metadata">

### Author: ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)
#### Post date: [July 11, 2022, 12:36pm UTC](https://discourse.cmake.org/t/the-x-c-flag/6043/2 "2022-07-11T12:36:24Z")

</div>

Have a look at the [LANGUAGE](https://cmake.org/cmake/help/latest/prop_sf/LANGUAGE.html) source property.
