Skip to content

Commit 034e680

Browse files
author
Ellery Newcomer
committed
dub configuration for windows
1 parent b3f7e36 commit 034e680

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

dub.json

+14-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@
2828
"Python_2_6_Or_Later",
2929
"Python_2_7_Or_Later",
3030
],
31-
"libs": ["python2.7"]
31+
"libs-posix": [
32+
"python2.7"
33+
],
34+
"libs-windows-dmd": [
35+
"$PYD_PACKAGE_DIR\\infrastructure\\windows\\python27_digitalmars"
36+
]
3237
},
3338
{
3439
"name": "python33",
@@ -42,7 +47,10 @@
4247
"Python_3_2_Or_Later",
4348
"Python_3_3_Or_Later",
4449
],
45-
"libs": ["python3.3m"],
50+
"libs-posix": ["python3.3m"],
51+
"libs-windows-dmd": [
52+
"$PYD_PACKAGE_DIR\\infrastructure\\windows\\python33_digitalmars"
53+
],
4654
"lflags-osx": ["-L/Library/Frameworks/Python.framework/Versions/3.3/lib/"]
4755
},
4856
{
@@ -58,7 +66,10 @@
5866
"Python_3_3_Or_Later",
5967
"Python_3_4_Or_Later",
6068
],
61-
"libs": ["python3.4m"],
69+
"libs-posix": ["python3.4m"],
70+
"libs-windows-dmd": [
71+
"$PYD_PACKAGE_DIR\\infrastructure\\windows\\python34_digitalmars"
72+
],
6273
"lflags-osx": ["-L/Library/Frameworks/Python.framework/Versions/3.4/lib/"]
6374
}
6475
]

examples/dub/shared_embedded/dub.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"authors": ["ariovistus"],
66
"dflags": ["-fPIC"],
77
"targetType": "dynamicLibrary",
8-
"dflags-dmd": ["-defaultlib=libphobos2.so"],
8+
"dflags-posix-dmd": ["-defaultlib=libphobos2.so"],
99
"dependencies": {
1010
"pyd": "0.9.3",
1111
},

examples/dub/simple_embedded/dub.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"copyright": "Copyright © 2014, ariovistus",
55
"authors": ["ariovistus"],
66
"targetType": "executable",
7-
"dflags-dmd": ["-defaultlib=libphobos2.so"],
7+
"dflags-posix-dmd": ["-defaultlib=libphobos2.so"],
88
"dependencies": {
99
"pyd": "0.9.3",
1010
},

generate_dub_config.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import json
22
import six
3+
import sys
34
import platform
5+
import os.path
46
from collections import OrderedDict
57
from pyd.patch_distutils import new_compiler
68
from distutils.command.build_ext import build_ext
@@ -33,7 +35,11 @@ def __init__(self):
3335
ext = build_ext(Distribution())
3436

3537
libraries = ext.get_libraries(MockExt())
36-
38+
lib_file = compiler._lib_file([])
39+
if lib_file:
40+
lib_file = os.path.basename(lib_file).replace(compiler.static_lib_extension, "")
41+
if sys.platform == 'win32':
42+
libraries.append(os.path.join('$PYD_PACKAGE_DIR','infrastructure', 'windows', lib_file))
3743
if __name__ == '__main__':
3844
config = OrderedDict()
3945
config['name'] = "python%s%s" % platform.python_version_tuple()[0:2]

0 commit comments

Comments
 (0)