Skip to content

Commit

Permalink
Make some compiler options work with mingw too (mhammond#1381)
Browse files Browse the repository at this point in the history
  • Loading branch information
joankaradimov authored and vernondcole committed Nov 16, 2019
1 parent 133b839 commit 94330bc
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,18 +438,19 @@ def finalize_options(self, build_ext):
break
if found_mfc:
break
# Handle Unicode - if unicode_mode is None, then it means True
# for py3k, false for py2
unicode_mode = self.unicode_mode
if unicode_mode is None:
unicode_mode = is_py3k
if unicode_mode:
self.extra_compile_args.append("/DUNICODE")
self.extra_compile_args.append("/D_UNICODE")
self.extra_compile_args.append("/DWINNT")
# Unicode, Windows executables seem to need this magic:
if "/SUBSYSTEM:WINDOWS" in self.extra_link_args:
self.extra_link_args.append("/ENTRY:wWinMainCRTStartup")

# Handle Unicode - if unicode_mode is None, then it means True
# for py3k, false for py2
unicode_mode = self.unicode_mode
if unicode_mode is None:
unicode_mode = is_py3k
if unicode_mode:
self.extra_compile_args.append("-DUNICODE")
self.extra_compile_args.append("-D_UNICODE")
self.extra_compile_args.append("-DWINNT")
# Unicode, Windows executables seem to need this magic:
if "/SUBSYSTEM:WINDOWS" in self.extra_link_args:
self.extra_link_args.append("/ENTRY:wWinMainCRTStartup")

class WinExt_pythonwin(WinExt):
def __init__ (self, name, **kw):
Expand Down

0 comments on commit 94330bc

Please sign in to comment.