Permalink
Browse files

Update setup.py

  • Loading branch information...
gdabah committed Jul 8, 2017
1 parent 7d8a174 commit 8e41b950e1c1697874d3ca63926e7c3a67dfa9dc
Showing with 8 additions and 13 deletions.
  1. +8 −13 setup.py
View
@@ -9,13 +9,16 @@
__revision__ = "$Id: setup.py 603 2010-01-31 00:11:05Z qvasimodo $"
import re
import os
import platform
import string
import shutil
import sys
import subprocess as sp
from glob import glob
from shutil import ignore_patterns
from distutils import log
from distutils.command.build import build
@@ -26,10 +29,6 @@
from distutils.core import setup, Extension
from distutils.errors import DistutilsSetupError
from shutil import ignore_patterns
import subprocess as sp
import re
def compile_vc(solution_path, config, platform):
match_vs = re.compile('vs(\d+)comntools$', re.I).match
compilers = [
@@ -43,26 +42,23 @@ def compile_vc(solution_path, config, platform):
'/p:Platform=%s' % platform,
solution_path
]
for ver, var in sorted(compilers, key=lambda v: -int(v[0])):
for ver, var in sorted(compilers, key = lambda v: -int(v[0])):
bat = os.path.join(os.environ[var], r'..\..\vc\vcvarsall.bat')
try:
log.info('compiling with %s: %s', var, ' '.join(msbuild))
sp.check_call(['call', bat, '&&'] + msbuild, shell=True)
log.info('Compiling with %s: %s', var, ' '.join(msbuild))
sp.check_call(['call', bat, '&&'] + msbuild, shell = True)
return
except sp.CalledProcessError:
log.info('compilation with %s failed', var)
raise DistutilsSetupError(
'failed to compile "%s" with any available compiler' % solution_path
'Failed to compile "%s" with any available compiler' % solution_path
)
def get_sources():
"""Returns a list of C source files that should be compiled to
create the libdistorm3 library.
"""
return glob('src/*.c')
return sorted(glob('src/*.c'))
class custom_build(build):
"""Customized build command"""
@@ -74,7 +70,6 @@ def run(self):
self.copy_file('distorm3.dll', 'python/distorm3')
build.run(self)
class custom_build_clib(build_clib):
"""Customized build_clib command

0 comments on commit 8e41b95

Please sign in to comment.