# is there a way to push linker output(MAP file) to separate log file in cmake

**URL:** <https://discourse.cmake.org/t/is-there-a-way-to-push-linker-output-map-file-to-separate-log-file-in-cmake/3218>\
**Category:** Code\
**Tags:** gen:ninja\
**Created:** [April 27, 2021, 10:28am UTC](https://discourse.cmake.org/t/is-there-a-way-to-push-linker-output-map-file-to-separate-log-file-in-cmake/3218 "2021-04-27T10:28:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepan](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@deepan](https://discourse.cmake.org/u/deepan)\
**Post date:** [April 27, 2021, 10:28am UTC](https://discourse.cmake.org/t/is-there-a-way-to-push-linker-output-map-file-to-separate-log-file-in-cmake/3218/1 "2021-04-27T10:28:59Z")

</div>

I am working in an embedded project with cmake version 3.18.5. The make file of type ninja. The command `ninja > log.txt` is adding all the log information(file name, warning) along with Map file into `log.txt` . I don’t want the map file info in `log.txt` I want the linker output(i.e Map file info) to a separate file and it should not pollute the main log file.

---

<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:** [April 27, 2021, 12:56pm UTC](https://discourse.cmake.org/t/is-there-a-way-to-push-linker-output-map-file-to-separate-log-file-in-cmake/3218/2 "2021-04-27T12:56:01Z")

</div>

AFAIK, you either need to add the redirection as part of your command in some way or use a wrapper to gather linker output. Ninja’s stdout is hooked up to the stdout all of the commands it runs. AFAIK, there’s no way to say “except this one”.
