8000 MinGW support by isuruf · Pull Request #36 · pybind/python_example · GitHub
[go: up one dir, main page]

Skip to content

MinGW support #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix removing directories
  • Loading branch information
isuruf committed Feb 20, 2019
commit 6be7a0cd40bb390e58a2b0aee4d24d996beffac7
17 changes: 9 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ def has_flag(compiler, flagname):
"""Return a boolean indicating whether a flag name is supported on
the specified compiler.
"""
import tempfile
with tempfile.NamedTemporaryFile('w', suffix='.cpp', delete=False) as f:
f.write('int main (int argc, char **argv) { return 0; }')
fname = f.name
try:
compiler.compile([fname], extra_postargs=[flagname])
except setuptools.distutils.errors.CompileError:
return False
import tempfile, os
with tempfile.TemporaryDirectory() as d:
fname = os.path.join(d, 'main.cpp')
with open(fname, 'w') as f:
f.write('int main (int argc, char **argv) { return 0; }')
try:
compiler.compile([fname], extra_postargs=[flagname])
except setuptools.distutils.errors.CompileError:
return False
return True


Expand Down
0