Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Using VS "configuration" while compiling (Read 707 times)
gj
Junior Member
**
Offline


Posts: 42
Joined: Feb 12th, 2016
Using VS "configuration" while compiling
Jun 10th, 2020 at 12:57pm
Print Post  
Hello,

I would like to use VS's configuration setting while compiling.
For example when configuration is "Debug" I want to include certain lines of code (eg. codes that will log stuff to a file for later analysis that I don't need in the final release), but when configuration is "Release" I don't want these lines of code to be present in the compiled program that is uploaded to the Arduino.

I know that "release" will prevent breakpoints (and it's associated code) to be excluded. This doesn't cover what I'm looking for.
I also know I could use "#define DEBUG" in combination with #ifdef DEBUG. 
While releasing I have to remember to comment-out the #define-line.
But this requires me not to forget it... combine that with me being only human.... and you see my issue.  Wink

Is there any way to accomplish this?
To be able to read Visual Studio's active configuration (Debug or Release or other ones I might define in Visual Studio)
« Last Edit: Jun 10th, 2020 at 12:58pm by gj »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Using VS "configuration" while compiling
Reply #1 - Jun 10th, 2020 at 4:30pm
Print Post  
Hi

In the project properties tool window there are a number of settings that relate to the current configuration. One is setting if #DEBUG and another is a list of defines.

That should be exactly what you need?

https://www.visualmicro.com/page/User-Guide.aspx?doc=Project-Properties-Referenc...
  
Back to top
WWW  
IP Logged
 
gj
Junior Member
**
Offline


Posts: 42
Joined: Feb 12th, 2016
Re: Using VS "configuration" while compiling
Reply #2 - Jun 10th, 2020 at 5:03pm
Print Post  
As always, your answers are so fast and so to the point.  Smiley
This is exactly what I need.

Thanks a lot.  Cheesy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint