Hi,
I have a problem while building a Cocos2d-x v2 project in Xcode 7 with code optimization enabled (anything above -O0).
Before Xcode 7 everything worked fine, but now I am getting a strange behaviour.
The problem occurs when using the CC_SYNTHESIZE macro. For example:
CC_SYNTHESIZE(bool, gravityFlipped_, GravityFlipped);
Without code optimization enabled it works as intended. But when code optimization is enabled this variable seems completely random. setGravityFlipped has no effect on the variable and it is always true.
The CC_SYNTHESIZE macro looks like this by default:
#define CC_SYNTHESIZE(varType, varName, funName)\
protected: varType varName;\
public: virtual varType get##funName(void) const { return varName; }\
public: virtual void set##funName(varType var){ varName = var; }
Manually writing the code instead of using the macro fixes the problem:
protected: bool gravityFlipped_;
public: virtual float getGravityFlipped(void) const { return gravityFlipped_; }
public: virtual void setGravityFlipped(float val) { gravityFlipped_ = val; }
Any idea what the underlying problem could be? Only happens when using code optimization.
Thanks

