You can use the extra_compile_args
parameter of distutils.core.Extension
:
ext = Extension('foo', sources=[....],
libraries=[....],
extra_compile_args=['-std=c++11'],
....)
Note that this is completely platform dependent. It won't even work on some older versions of gcc and clang.