Allow disabling c++ code generation

Change-Id: I0d8d13a580713efb5ba5d5ee543e8446a6c73503