Add the build release of the source code in the compilation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add the build release of the source code in the compilation

302 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by camargomarcior on Mon Dec 15 08:25:15 MST 2014
Hi,

To better control of the revision of the compiled code I want put in the display the build release of the code, it´s possible in the lpcXpresso ??

Marcio
0 Kudos
3 Replies

253 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Dec 16 00:53:19 MST 2014
There is nothing in LPCXpresso that will count build numbers, but if you can do this externally and set an environment variable, then you can pass that into LPCXpresso and set a compiler switch.

If your build number is store in an environment variable call "BUILD_NUM":

In the Compiler properties under "Symbols" define symbol
BUILD_NUMBER=${env_var:BUILD_NUM}


Then to use it in your source code, you need to do this
#define STR(x)#x
#define STRINGIZE(x)STR(x)

#define VERSION "(Build " STRINGIZE(BUILD_NUMBER) ")"

0 Kudos

253 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by camargomarcior on Mon Dec 15 09:34:08 MST 2014
I´m sorry if I was not clear.

Per example, in lpcXpresso the release is LPCXpresso v7.5.0 [Build 254]. I think the value v7.5.0 is the version value and the 254 is the compilation version of the software.

I want to do the same process in my firmware, do you now if exist a macro or other type of parameter to use to do it ?

0 Kudos

253 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Dec 15 08:48:36 MST 2014
I'm sorry but it is not clear what you are asking.

Do you want to add a version number string into your application? If so, where is the version number defined?
0 Kudos