How to define preprocessor flags when creating gen-libs?

Hey
i want to build cocose2dx lib with box2d support
how can i pass CC_ENABLE_BOX2D_INTEGRATION preprocessor flag when building with this command :
cocos gen-libs -p win32 --vs 2015 -m debug

Do i need to open VS set the flags , save and then build ? or there is easy way to do this ?

UPDATE
After trying to set the flag in cocos2dx.lib project in VC and then compile using cocos gen-libs im getting error

CCPhysicsSprite.obj : error LNK2001: unresolved external symbol "public: void __thiscall b2Body::SetTransform(st
       ruct b2Vec2 const &,float)" (?SetTransform@b2Body@@QAEXABUb2Vec2@@M@Z) [d:\Dev\my\cpp\2d\cocos2d-x-3.16\cocos\2d
       \libcocos2d.vcxproj]
     3>CCNavMesh.obj : error LNK2001: unresolved external symbol "void * __cdecl dtAlloc(int,enum dtAllocHint)" (?dtAll
       oc@@YAPAXHW4dtAllocHint@@@Z) [d:\Dev\my\cpp\2d\cocos2d-x-3.16\cocos\2d\libcocos2d.vcxproj]
     3>CCNavMeshUtils.obj : error LNK2001: unresolved external symbol "void * __cdecl dtAlloc(int,enum dtAllocHint)" (?
       dtAlloc@@YAPAXHW4dtAllocHint@@@Z) [d:\Dev\my\cpp\2d\cocos2d-x-3.16\cocos\2d\libcocos2d.vcxproj]
     3>CCNavMesh.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall dtNavMesh::init(struc
       t dtNavMeshParams const *)" (?init@dtNavMesh@@QAEIPBUdtNavMeshParams@@@Z) [d:\Dev\my\cpp\2d\cocos2d-x-3.16\cocos
       \2d\libcocos2d.vcxproj]
     3>CCNavMesh.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall dtNavMesh::getOffMesh
       ConnectionPolyEndPoints(unsigned int,unsigned int,float *,float *)const " (?getOffMeshConnectionPolyEndPoints@dt
       NavMesh@@QBEIIIPAM0@Z) [d:\Dev\my\cpp\2d\cocos2d-x-3.16\cocos\2d\libcocos2d.vcxproj]
     3>CCNavMesh.obj : error LNK2001: unresolved external symbol "class dtNavMesh * __cdecl dtAllocNavMesh(void)" (?dtA
       llocNavMesh@@YAPAVdtNavMesh@@XZ) [d:\Dev\my\cpp\2d\cocos2d-x-3.16\cocos\2d\libcocos2d.vcxproj]
     3>CCNavMesh.obj : error LNK2001: unresolved external symbol "void __cdecl dtFreeNavMesh(class dtNavMesh *)" (?dtFr

Did you ever figure this out? It’s so frustrating because it seems to be the physics engine that everyone wants to use but there seems to be no way to do it. Every forum thread that deals with it just fizzles out and every version of cocos2d-x seems to have some completely different and mostly broken way of using it.

Yes i did make it work . the procedure is to open the Cocos2d-x tests or project in your IDE in my example is VS and set the box2d flag as shown in this tutorial :

Then save it , now the configuration is saved into the project files don’t compile it via the IDE .

then excute the gen-libs command as it using the VS project files you previously saved