mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
distutils_rust: teach distutils to look for windows libs
Summary: Make sure that we can build Rust extensions on Windows. Test Plan: - `set USERUST=1` - run FB build script, which invokes `fb-hgext`'s `setup.py` - see it not failing Reviewers: mbthomas, #fbhgext Differential Revision: https://phab.mercurial-scm.org/D1590
This commit is contained in:
parent
df45dfb7fc
commit
e00b7af3c3
@ -75,12 +75,13 @@ class BuildRustExt(Command):
|
|||||||
def get_temp_output(self, ext):
|
def get_temp_output(self, ext):
|
||||||
"""Returns the location in the temp directory of the output file."""
|
"""Returns the location in the temp directory of the output file."""
|
||||||
platform = distutils.util.get_platform()
|
platform = distutils.util.get_platform()
|
||||||
if platform.startswith('macosx'):
|
if platform.startswith('win-'):
|
||||||
libsuffix = '.dylib'
|
name = ext.name + '.dll'
|
||||||
|
elif platform.startswith('macosx'):
|
||||||
|
name = 'lib' + ext.name + '.dylib'
|
||||||
else:
|
else:
|
||||||
libsuffix = '.so'
|
name = 'lib' + ext.name + '.so'
|
||||||
return os.path.join('debug' if self.debug else 'release',
|
return os.path.join('debug' if self.debug else 'release', name)
|
||||||
'lib' + ext.name + libsuffix)
|
|
||||||
|
|
||||||
def get_output_filename(self, ext):
|
def get_output_filename(self, ext):
|
||||||
"""Returns the filename of the build output."""
|
"""Returns the filename of the build output."""
|
||||||
|
Loading…
Reference in New Issue
Block a user