Mercurial > hg
comparison setup.py @ 40397:36b134c436b8
setup: build exewrapper with Unicode support on py3
I didn't see a compiler switch documented anywhere, but I diffed the command
line for full VC++ project when toggling between MBCS and Unicode. This is all
they do.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 19 Oct 2018 18:34:42 -0400 |
parents | a9e303dcd1e1 |
children | b6bc2293cdf3 |
comparison
equal
deleted
inserted
replaced
40396:973ff03d9bc0 | 40397:36b134c436b8 |
---|---|
629 | 629 |
630 log.info('using %s as Python library name' % pythonlib) | 630 log.info('using %s as Python library name' % pythonlib) |
631 with open('mercurial/hgpythonlib.h', 'wb') as f: | 631 with open('mercurial/hgpythonlib.h', 'wb') as f: |
632 f.write(b'/* this file is autogenerated by setup.py */\n') | 632 f.write(b'/* this file is autogenerated by setup.py */\n') |
633 f.write(b'#define HGPYTHONLIB "%s"\n' % pythonlib) | 633 f.write(b'#define HGPYTHONLIB "%s"\n' % pythonlib) |
634 | |
635 macros = None | |
636 if sys.version_info[0] >= 3: | |
637 macros = [('_UNICODE', None), ('UNICODE', None)] | |
638 | |
634 objects = self.compiler.compile(['mercurial/exewrapper.c'], | 639 objects = self.compiler.compile(['mercurial/exewrapper.c'], |
635 output_dir=self.build_temp) | 640 output_dir=self.build_temp, |
641 macros=macros) | |
636 dir = os.path.dirname(self.get_ext_fullpath('dummy')) | 642 dir = os.path.dirname(self.get_ext_fullpath('dummy')) |
637 self.hgtarget = os.path.join(dir, 'hg') | 643 self.hgtarget = os.path.join(dir, 'hg') |
638 self.compiler.link_executable(objects, self.hgtarget, | 644 self.compiler.link_executable(objects, self.hgtarget, |
639 libraries=[], | 645 libraries=[], |
640 output_dir=self.build_temp) | 646 output_dir=self.build_temp) |