# What does --strip do?

**URL:** <https://discourse.cmake.org/t/what-does-strip-do/4302>\
**Category:** Usage\
**Created:** [October 18, 2021, 7:24pm UTC](https://discourse.cmake.org/t/what-does-strip-do/4302 "2021-10-18T19:24:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![buildSystemPerson](https://discourse.cmake.org/user_avatar/discourse.cmake.org/buildsystemperson/32/2851_2.png) [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Post date:** [October 18, 2021, 7:24pm UTC](https://discourse.cmake.org/t/what-does-strip-do/4302/1 "2021-10-18T19:24:55Z")

</div>

In the cmake docs for installing there is a [–strip](https://cmake.org/cmake/help/latest/manual/cmake.1.html#install-a-project) flag:

```auto
--strip

    Strip before installing.

```

What does this do?

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [October 18, 2021, 10:31pm UTC](https://discourse.cmake.org/t/what-does-strip-do/4302/2 "2021-10-18T22:31:02Z")

</div>

It removes debuginfo and things like internal symbol names from the libraries once installed. Basically, it can make the install tree size smaller (though how much depends on the libraries in question).

---

<div class="post-metadata">

**Author:** ![buildSystemPerson](https://discourse.cmake.org/user_avatar/discourse.cmake.org/buildsystemperson/32/2851_2.png) [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Post date:** [October 18, 2021, 10:31pm UTC](https://discourse.cmake.org/t/what-does-strip-do/4302/3 "2021-10-18T22:31:57Z")

</div>

From what I can tell this doesn’t do anything with MSVC though. It seems to be for GCC and maybe clang?

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [October 18, 2021, 10:32pm UTC](https://discourse.cmake.org/t/what-does-strip-do/4302/4 "2021-10-18T22:32:59Z")

</div>

Yes, MSVC tends to have separate debuginfo anyways (the `.pdb` files). CMake does what it can (nothing) rather than erroring and making scripts have to know the environment before passing it. However, maybe it can do something in the future even there (if there’s anything meaningful to do that is).

---

<div class="post-metadata">

**Author:** ![buildSystemPerson](https://discourse.cmake.org/user_avatar/discourse.cmake.org/buildsystemperson/32/2851_2.png) [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Post date:** [October 18, 2021, 10:35pm UTC](https://discourse.cmake.org/t/what-does-strip-do/4302/5 "2021-10-18T22:35:19Z")

</div>

For other windows programmers (Like me) here is a useful wikipedia entry after looking into it:

> **[strip (Unix)](https://en.wikipedia.org/wiki/Strip_(Unix))**
>
> In Unix, Plan 9, and Unix-like operating systems, the strip program removes information from executable binary programs and object files that is not essential or required for normal and correct execution, thus potentially resulting in better performance and sometimes significantly less disk space usage.
> The information removed may consist of debugging and symbol information; however, the standard leaves the scope of the changes to the binary up to the implementer of the stripping program\[citatio...
