Skip to content

Commit f88e2df

Browse files
committed
Update build for windows.
1 parent 1bd611d commit f88e2df

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

SConstruct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ if platform.system().lower() == "windows":
149149
# Insert LIBRARY_PATH explicitly because some compilers
150150
# ignore it in the system environment.
151151
env.PrependUnique(LIBPATH=getsyspaths('LIBRARY_PATH'))
152-
if vars['prefix'] is not None:
152+
if env['prefix'] is not None:
153153
env.Append(CPPPATH=[pjoin(env['prefix'], 'include')])
154154
env.Append(CPPPATH=[pjoin(env['prefix'], 'Library', 'include')])
155155
# Windows conda library paths are a MESS ('lib', 'libs', 'Library\lib'...)
@@ -160,7 +160,7 @@ if platform.system().lower() == "windows":
160160
env.AppendUnique(CPPDEFINES='BOOST_ALL_NO_LIB')
161161
# Prevent the generation of an import lib (.lib) in addition to the dll
162162
# env.AppendUnique(no_import_lib=1)
163-
env.PrependUnique(CCFLAGS=['/Ox', '/EHsc'])
163+
env.PrependUnique(CCFLAGS=['/Ox', '/EHsc', '/MD'])
164164
env.AppendUnique(CPPDEFINES={'NDEBUG': None})
165165
else:
166166
if 'CONDA_BUILD' not in os.environ:

conda-recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ requirements:
2020
- {{ compiler('cxx') }}
2121
- numpy {{ numpy }}
2222
- python {{ python }}
23+
- setuptools
2324
- git
2425
host:
2526
- python
2627
- pip
27-
- setuptools
2828
- numpy
2929
- libobjcryst 2022.1.1
3030
- boost {{ boost }}

setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"""
1010

1111
import os
12+
from os.path import join as pjoin
1213
import re
1314
import sys
1415
import glob
@@ -27,9 +28,16 @@
2728
'extra_compile_args': ['-std=c++11', '-DBOOST_ERROR_CODE_HEADER_ONLY'],
2829
'extra_link_args': [],
2930
'include_dirs': get_numpy_include_dirs(),
31+
'library_dirs': []
3032
}
3133
if platform.system() == 'Windows':
3234
ext_kws['extra_compile_args'] = ['-DBOOST_ERROR_CODE_HEADER_ONLY']
35+
if 'CONDA_PREFIX' in os.environ:
36+
ext_kws['include_dirs'] += [pjoin(os.environ['CONDA_PREFIX'], 'include'),
37+
pjoin(os.environ['CONDA_PREFIX'], 'Library', 'include')]
38+
ext_kws['library_dirs'] += [pjoin(os.environ['CONDA_PREFIX'], 'Library', 'lib'),
39+
pjoin(os.environ['CONDA_PREFIX'], 'libs')]
40+
ext_kws['libraries'] = ['libObjCryst']
3341
elif platform.system() == 'Darwin':
3442
ext_kws['extra_compile_args'] += ['-fno-strict-aliasing']
3543

0 commit comments

Comments
 (0)