Configuration file: any way to get a boolean value? #252
-
I have a configuration file for my app
And it works as expected:
Can I add a boolean variable that is true for "Debug" builds only?
Can I do this in chalet? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hmmm... You can obviously do this any number of ways, but I'm used to using a preprocessor definition at build time: "settings:Cxx": {
"defines[:debug]": [
"_DEBUG"
]
} namespace app1::constants
{
#if defined(_DEBUG)
constexpr bool debug = true;
#else
constexpr bool debug = false;
#endif
} So you can do that in the meantime, but yes - I think there should be some mechanism for boolean values like you describe. I'll have to revisit config files because right now the same one is shared across build configurations, so it's a bug to put the |
Beta Was this translation helpful? Give feedback.
Hmmm... You can obviously do this any number of ways, but I'm used to using a preprocessor definition at build time:
So you can do that in the meantime, but yes - I think there should be some mechanism for boolean values like you describe. I'll have to revisit config files because right now the same one is shared across build configurations, so it's a bug to put the
${configuration}
string into it at the moment. It was mainly designed with versioning in mind.