|
|
@ -17,11 +17,8 @@ def has_flag(compiler, flagname): |
|
|
|
""" |
|
|
|
""" |
|
|
|
import tempfile |
|
|
|
import tempfile |
|
|
|
fd, fname = tempfile.mkstemp('.cpp', 'main', text=True) |
|
|
|
fd, fname = tempfile.mkstemp('.cpp', 'main', text=True) |
|
|
|
f = os.fdopen(fd, 'w') |
|
|
|
with os.fdopen(fd, 'w') as f: |
|
|
|
try: |
|
|
|
|
|
|
|
f.write('int main (int argc, char **argv) { return 0; }') |
|
|
|
f.write('int main (int argc, char **argv) { return 0; }') |
|
|
|
finally: |
|
|
|
|
|
|
|
f.close() |
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
compiler.compile([fname], extra_postargs=[flagname]) |
|
|
|
compiler.compile([fname], extra_postargs=[flagname]) |
|
|
|
except setuptools.distutils.errors.CompileError: |
|
|
|
except setuptools.distutils.errors.CompileError: |
|
|
|