build-cpp / cmkr

Modern build system based on CMake and TOML.
https://cmkr.build
MIT License
423 stars 28 forks source link

Support conditions for build type #104

Open mrexodia opened 1 year ago

mrexodia commented 1 year ago

For multi-config generators there is an annoying thing that you cannot easily make debug/release-only flags. The idea would be:

[target.foo]
type = "executable"
sources = ["..."]
debug.compile-options = ["/DEBUGME"]

This would emit the correct generator expression.

An open question is still how to handle conditional debug flags. Perhaps something like:

[target.foo]
debug = { condition.compile-options = ["/DEBUGME"] }