# Ninja Multi-Config No Work To Do On --Build --Config Change

**URL:** https://discourse.cmake.org/t/ninja-multi-config-no-work-to-do-on-build-config-change/8994
**Category:** Usage
**Tags:** gen:ninja
**Created:** [September 16, 2023, 10:52pm UTC](https://discourse.cmake.org/t/ninja-multi-config-no-work-to-do-on-build-config-change/8994 "2023-09-16T22:52:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Blazefire](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ecd19e/32.png) [@Blazefire](https://discourse.cmake.org/u/Blazefire)
#### Post date: [September 16, 2023, 10:52pm UTC](https://discourse.cmake.org/t/ninja-multi-config-no-work-to-do-on-build-config-change/8994/1 "2023-09-16T22:52:22Z")

</div>

Sorry I am brand new to cmake and ninja was trying to figure out how to switch my project from release and debug. I build using a multi-config ninja generator like this

```auto
cmake -S ./ -B ./build -G "Ninja Multi-Config" 
cmake --build ./build --config Debug

```

rerunning the commands with --config Release gives me the message of `ninja: no work to do.` so how do I change configs as my asserts still fire? also what would be the correct macro to use for checking if my project is in debug mode in my code?

---

<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: [September 18, 2023, 8:31am UTC](https://discourse.cmake.org/t/ninja-multi-config-no-work-to-do-on-build-config-change/8994/2 "2023-09-18T08:31:42Z")

</div>

> [@Blazefire](#):
>
> also what would be the correct macro to use for checking if my project is in debug mode in my code?

`NDEBUG` is the typical way, but you can also add `target_compile_definitions(${tgt} PRIVATE BUILD_CONFIG=$<CONFIG>)`.

As for the core problem, more context is needed. Can you trim down the project to a minimal test case that exhibits the problem and share that?

Cc: @kyle.edwards

---

<div class="post-metadata">

### Author: ![Blazefire](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ecd19e/32.png) [@Blazefire](https://discourse.cmake.org/u/Blazefire)
#### Post date: [September 20, 2023, 2:47am UTC](https://discourse.cmake.org/t/ninja-multi-config-no-work-to-do-on-build-config-change/8994/3 "2023-09-20T02:47:27Z")

</div>

Hello thanks for the advice. `NDEBUG` did the trick for the macro. Also when making the smaller project to test and give here, everything worked as expected so I went to debug my project. Looking at the output of my build script I found an terminal line buried saying I needed to delete my cache to swap `Multi-Conifg` generator. Sorry for the trouble and thanks for the help.
