Fixed #4857: Add check to cc._setup to avoid double invocation