Added CC_STATIC support for 3d, all these commits will be squashed and renamed, structured and signed at the end