Setting Compiler Constants with Build VS.Net Solution in FB6

Hello,

I am trying to override some compiler constants with the the "Build VS.Net Solution" task

I checked "overide compiler settings" in the build pane and entered the following in "compiler constants": 

_RELEASE=%DefineRelease%;_MAJOR_VERSION=%DefineMajorVersion%;_MINOR_VERSION=%DefineMinorVersion

(I have reason why I don t want to use the provided action properties for versionning... they just are a bit lenghty to explain)

Does not seem to work (the compiler cannot resolve the macros)?

Can someone help me figure out why?

Thanks!

Hi Charlie,

The action seems to be working as expected here, could you send the command line arguments that FinalBuilder is generating so we can see what’s been sent to Visaul Studio?

i.e.

Running C:\Windows\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe with parameters : /t:Build /logger:“I:\FB6Branch\FinalBuilder\FinalBuilder.MSBuild.Tasks.dll” /noconlog /p:Configuration=“Debug”;Platform=“Any CPU”;DefineConstants="_RELEASE=True";Optimize=False;AllowUnsafeBlocks=False /v:normal “C:\Users\paul\Documents\Visual Studio 2008\Projects\ConsoleApplication1\ConsoleApplication1.sln”

Regards,
Paul.

Thanks Paul,

Here is what I have (with diagnostic log level)

Running C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe with parameters : /t:Rebuild /logger:“C:\Program Files\FinalBuilder 6\FinalBuilder.MSBuild.Tasks.dll” /noconlog /p:Configuration=“Release”;Platform=“Win32”;DefineConstants="_RELEASE=3;_MAJOR_VERSION=3;_MINOR_VERSION=3";Optimize=False;AllowUnsafeBlocks=False;WarningLevel=4;TreatWarningsAsErrors=False;NoWarn=“4996” /v:diagnostic “E:\BuildServer\Source\CPP\Utilities\UtilityLibrary.sln”

Charlie

What you are trying to do is not valid. With DefineConstants you are either defining a constant or you are not. This topic on stack overflow has a good discussion on it :
http://stackoverflow.com/questions/166474/msbuild-set-a-specific-preprocessor-define-in-the-command-line