This repository has been archived by the owner on Oct 19, 2023. It is now read-only.
forked from PyMySQL/mysqlclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_windows.py
64 lines (53 loc) · 1.55 KB
/
setup_windows.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import os
import sys
def get_config():
from setup_common import get_metadata_and_options, create_release_file
metadata, options = get_metadata_and_options()
client = "mariadbclient"
connector = os.environ.get("MYSQLCLIENT_CONNECTOR", options.get("connector"))
if not connector:
connector = os.path.join(
os.environ["ProgramFiles"], "MariaDB", "MariaDB Connector C"
)
extra_objects = []
library_dirs = [
os.path.join(connector, "lib", "mariadb"),
os.path.join(connector, "lib"),
]
libraries = [
"kernel32",
"advapi32",
"wsock32",
"shlwapi",
"Ws2_32",
"crypt32",
"secur32",
"bcrypt",
client,
]
include_dirs = [
os.path.join(connector, "include", "mariadb"),
os.path.join(connector, "include"),
]
extra_link_args = ["/MANIFEST"]
name = "mysqlclient-collate"
metadata["name"] = name
define_macros = [
("version_info", metadata["version_info"]),
("__version__", metadata["version"]),
]
create_release_file(metadata)
del metadata["version_info"]
ext_options = dict(
library_dirs=library_dirs,
libraries=libraries,
extra_link_args=extra_link_args,
include_dirs=include_dirs,
extra_objects=extra_objects,
define_macros=define_macros,
)
return metadata, ext_options
if __name__ == "__main__":
sys.stderr.write(
"""You shouldn't be running this directly; it is used by setup.py."""
)