# Compiler flag for debug mode only?

**URL:** <https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872>\
**Category:** The Projucer\
**Created:** [May 6, 2021, 12:56pm UTC](https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872 "2021-05-06T12:56:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolasdanet](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/nicolasdanet/32/56_2.png) [@nicolasdanet](https://forum.juce.com/u/nicolasdanet)\
**Post date:** [May 6, 2021, 12:56pm UTC](https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872/1 "2021-05-06T12:56:11Z")

</div>

It seems that compiler flags for debug/release mode only hasn’t been implemented yet.

1. Is it scheduled?
2. Is there a workaround (i’m concern by debug flags on linux).

> [@Introjucer Compiler Options, Debug only or Release only](https://forum.juce.com/t/introjucer-compiler-options-debug-only-or-release-only/15919/2):
>
> Hmm, good request, I thought it did that, but apparently&nbsp;not! Easy enough for us to add, will do soon!

> [@Add "Extra Compiler Flags" for each plug-in type in Projucer](https://forum.juce.com/t/add-extra-compiler-flags-for-each-plug-in-type-in-projucer/21172/2):
>
> Hi Dan, sounds like a reasonable request but it would be a lot of work in the Projucer’s code and adding some UX to the Projucer to support it nicely. Also, right now, the Projucer does not even support setting individual compiler flags for debug/release (apart from optimisation flags, code-stripping and options related to floating point support). So we’d probably add that first. It’s not something we have time for right now but I’ve added it to our backlog. Fabian

---

<div class="post-metadata">

**Author:** ![nicolasdanet](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/nicolasdanet/32/56_2.png) [@nicolasdanet](https://forum.juce.com/u/nicolasdanet)\
**Post date:** [May 6, 2021, 1:26pm UTC](https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872/2 "2021-05-06T13:26:55Z")

</div>

Ok it doesn’t matter. Just wanted to add `-fno-omit-frame-pointer` for debug mode.  
But after investigations, it seems not required.

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [August 23, 2022, 10:40pm UTC](https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872/3 "2022-08-23T22:40:02Z")

</div>

+1, want to add Basic Runtime Checks to debug /RTC1

---

<div class="post-metadata">

**Author:** ![benvining](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benvining/32/9922_2.png) [@benvining](https://forum.juce.com/u/benvining)\
**Post date:** [August 23, 2022, 10:45pm UTC](https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872/4 "2022-08-23T22:45:26Z")

</div>

The best answer to this is, use CMake 😉

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [August 24, 2022, 6:10am UTC](https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872/5 "2022-08-24T06:10:07Z")

</div>

I already considered Cmake. But this is not a simple task for me, because I have multiple projects and tools, some of them directly interact with the jucer files. Also I have to be 100% sure that there is no change in the resulting binaries, plug-ins, which need to be compatible to their hosts. This all needs to be carefully checked and considered.

So my big request is to add Additional Compiler Flags to the build configurations. Which would be great addition to the already complete feature set.

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [September 2, 2022, 10:41am UTC](https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872/6 "2022-09-02T10:41:04Z")

</div>

Bump, even if every projucer request ends with you getting a recommendation to switch to cmake (which seems to be a complete easy peasy task ;-), I would kindly ask, if we can get build configuration specific compiler flags in the good old projucer for VS. This is a little change which gives us a lot of flexibility. Thanks!

---

<div class="post-metadata">

**Author:** ![PeterRoos](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@PeterRoos](https://forum.juce.com/u/PeterRoos)\
**Post date:** [October 23, 2022, 11:38am UTC](https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872/7 "2022-10-23T11:38:43Z")

</div>

Same request from me. Googling for this quite simple feature results in answers going back several years:

- Yes this is easy, I thought I added that (Jules)
- It’s on the/a list (team)
- Use CMake (the real pros here)

I know this will never be added, but I want to bump this anyway.

[Edit] I was wrong here, nice!

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [October 23, 2022, 12:44pm UTC](https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872/8 "2022-10-23T12:44:58Z")

</div>

I didn‘t checked it yet, according to this commit, this feature was added here

> <https://github.com/juce-framework/JUCE/commit/15d9d35454f6adb44947a35c7f05564b7539faba>

---

<div class="post-metadata">

**Author:** ![PeterRoos](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@PeterRoos](https://forum.juce.com/u/PeterRoos)\
**Post date:** [October 23, 2022, 1:04pm UTC](https://forum.juce.com/t/compiler-flag-for-debug-mode-only/45872/9 "2022-10-23T13:04:21Z")

</div>

Amazing, my Projucer build is from one day before that (28 Sept).

Super!

Thanks so much for this news and fix, @chkn and Team, that I completely missed.
