|
-
July 12th, 2009, 06:11 AM
#1
Tell compilation mode from code?
1. Can a C++ program tell in which mode it was built, i.e. debug or release?
Code:
#if BUILD_MODE == DEBUG
#endif
2. Can I access the compile macros, e.g. $(ConfigurationName), from the code?
-
July 12th, 2009, 06:40 AM
#2
Re: Tell compilation mode from code?
#ifdef _DEBUG
// Program is compiled in debug mode
#endif
Open Project Properties, C++, Precompiler, Preprocessor definitions. Here you can see all precompiler constants defined in the project. _DEBUG is defined in Debug configuration and not defined in Release configuration. You can add your own constants here and work with them in the code.
$(ConfigurationName) is macro for build tools, it is not available in the code.
-
July 12th, 2009, 06:53 AM
#3
Re: Tell compilation mode from code?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|