# Dumping compiler definitions

**URL:** https://discourse.cmake.org/t/dumping-compiler-definitions/11166
**Category:** Usage
**Tags:** os:linux
**Created:** [July 4, 2024, 8:29pm UTC](https://discourse.cmake.org/t/dumping-compiler-definitions/11166 "2024-07-04T20:29:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![SeeMakeDo](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@SeeMakeDo](https://discourse.cmake.org/u/SeeMakeDo)
#### Post date: [July 4, 2024, 8:29pm UTC](https://discourse.cmake.org/t/dumping-compiler-definitions/11166/1 "2024-07-04T20:29:33Z")

</div>

Allegedly, giving the gcc compiler the options “-E -dM” will make it dump out all the #define definitions it knows. I tried putting this into a **target\_compile\_options** but it did not seem to have any effect. This is cross-compiling for an ARM microprocessor if that makes any difference, but I expect the preprocessor to be the same.

```auto
target_compile_options( FreeRTOS PRIVATE
  # Dump symbols
  -E -dM
)

```

This did work earlier for the “-save-temps” option.

---

<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: [July 17, 2025, 5:27pm UTC](https://discourse.cmake.org/t/dumping-compiler-definitions/11166/2 "2025-07-17T17:27:49Z")

</div>

When using `-E`, the `-o` flag is used for the output of the preprocessor output, so the “object file” is your expected output (and the rest of the build is going to choke on them not being actual objects).
