Skip to content

Commit

Permalink
remove msvc hack
Browse files Browse the repository at this point in the history
does not apply on latest setuptools
  • Loading branch information
asottile committed Oct 26, 2024
1 parent e468db2 commit 362f2dd
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,7 @@ def customize_compiler(compiler):
elif filename.endswith('.h'):
headers.append(filename)

if sys.platform == 'win32':
from distutils.msvc9compiler import get_build_version
vscomntools_env = 'VS{}{}COMNTOOLS'.format(
int(get_build_version()),
int(get_build_version() * 10) % 10,
)
try:
os.environ[vscomntools_env] = os.environ['VS140COMNTOOLS']
except KeyError:
distutils.log.warn(
'You probably need Visual Studio 2015 (14.0) '
'or higher',
)
from distutils import msvccompiler, msvc9compiler
if msvccompiler.get_build_version() < 14.0:
msvccompiler.get_build_version = lambda: 14.0
if get_build_version() < 14.0:
msvc9compiler.get_build_version = lambda: 14.0
msvc9compiler.VERSION = 14.0
elif platform.system() in {'Darwin', 'FreeBSD', 'OpenBSD'}:
if platform.system() in {'Darwin', 'FreeBSD', 'OpenBSD'}:
# Dirty workaround to avoid link error...
# Python distutils doesn't provide any way
# to configure different flags for each cc and c++.
Expand Down

0 comments on commit 362f2dd

Please sign in to comment.