Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

How to distinguish PRODUCTION and DEVELOPMENT builds using #ifdef

Hello,

 

I spent some time with investigating how to do it and I was not successful so I would like to ask you for help.

 

I'm going to use 

 

#ifdef SOMETHING

   // development code

#endif

 

to alternate production and development code and I didn't find place where to put defininition of SOMETHING for mark debug builds.

 

I tried it in .pro file, in C/C++ build in Eclipse but none worked for me.

 

Does anybody have any clue?


Thanks

Tom

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: How to distinguish PRODUCTION and DEVELOPMENT builds using #ifdef

Qt defines QT_NO_DEBUG for release builds. Otherwise QT_DEBUG is defined.

Andrey Fidrya, @zmeyc on twitter
New Developer
Posts: 11
Registered: ‎03-14-2013
My Device: z10 , q10
My Carrier: vodaphone

Re: How to distinguish PRODUCTION and DEVELOPMENT builds using #ifdef

Did you find any solution, I have a cascades solution and would like to have #ifdef to switch between dev url and producion url also i would want to change the icon of the app depending on how its built.

New Developer
Posts: 11
Registered: ‎03-14-2013
My Device: z10 , q10
My Carrier: vodaphone

Re: How to distinguish PRODUCTION and DEVELOPMENT builds using #ifdef

Found a solution, works well

 

http://supportforums.blackberry.com/t5/Cascades-Development/Creating-a-new-build-configuration/m-p/2...

 

also added, icon copy to replace icons for live.

 

arm-test/Makefile: $(QMAKE_TARGET).pro

Device-Test-Release:
$(info ***** This is my custom make target ***** )
@mkdir -p arm-test
cp ./adminicon.png ./icon.png
cd arm-test && $(QMAKE) -spec blackberry-armv7le-qcc ../$(QMAKE_TARGET).pro CONFIG+=debug_and_release CONFIG+=device CONFIG+=test
$(MAKE) -C ./arm-test -f Makefile release