Add option for cpp_extensions to compile standalone executable (#47862)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47862
Test Plan: Imported from OSS
Reviewed By: ngimel
Differential Revision: D25199265
Pulled By: robieta
fbshipit-source-id: eceb04dea60b82eb10434099639fa3afa61000ca