Skip to content

Commit

Permalink
Merge pull request #363 from scottgigante/bugfix/msvc_arch
Browse files Browse the repository at this point in the history
Allow setting windows arch with environment variable
  • Loading branch information
Leonid Boytsov authored and GitHub committed Dec 24, 2018
2 parents 21049cc + 0527d28 commit 8b38417
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python_bindings/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ class BuildExt(build_ext):
'msvc': ['/EHsc', '/openmp', '/O2'],
'unix': ['-O3'],
}
if 'ARCH' in os.environ:
# /arch:[IA32|SSE|SSE2|AVX|AVX2|ARMv7VE|VFPv4]
# See https://docs.microsoft.com/en-us/cpp/build/reference/arch-x86
c_opts['msvc'].append("/arch:{}".format(os.envrion['ARCH']))
if 'CFLAGS' not in os.environ or "-march" not in os.environ["CFLAGS"]:
c_opts['unix'].append('-march=native')
link_opts = {
Expand Down

0 comments on commit 8b38417

Please sign in to comment.