Skip to content

Commit b844470

Browse files
Fix windows build problems; bump version.
1 parent 6e07b95 commit b844470

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

python/setup.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import sys
22
import os.path
33
import codecs
4+
import platform
45
from setuptools import setup, Extension
56
from setuptools.command.build_ext import build_ext
67

78

9+
IS_WINDOWS = platform.system() == "Windows"
10+
11+
812
# Obscure magic required to allow numpy be used as a 'setup_requires'.
913
# Based on https://stackoverflow.com/questions/19919905
1014
class local_build_ext(build_ext):
@@ -34,10 +38,19 @@ def finalize_options(self):
3438
os.path.join(libdir, f) for f in tsk_source_files] + [
3539
os.path.join(kastore_dir, "kastore.c")]
3640

41+
defines = []
42+
libraries = []
43+
if IS_WINDOWS:
44+
# Needed for generating UUIDs
45+
libraries.append("Advapi32")
46+
defines.append(("WIN32", None))
47+
3748
_tskit_module = Extension(
3849
'_tskit',
3950
sources=sources,
4051
extra_compile_args=["-std=c99"],
52+
libraries=libraries,
53+
define_macros=defines,
4154
# Enable asserts
4255
undef_macros=["NDEBUG"],
4356
include_dirs=[libdir, kastore_dir],

python/tskit/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Definitive location for the version number.
2-
tskit_version = "0.1.0a1"
2+
tskit_version = "0.1.0a2"

0 commit comments

Comments
 (0)