-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
46 lines (40 loc) · 1.24 KB
/
setup.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
import sys
import os
from glob import glob
from setuptools import setup, find_packages
from pybind11.setup_helpers import Pybind11Extension, build_ext
macros = []
link_libararies = ["sodium"]
runtime_libs = []
extra_args = []
extra_link_args = []
library_dirs = []
include_dirs = ["CryptoLib"]
VCPKG_PORT_BASE_PATH = (
os.sep.join(glob("vcpkg_installed/**/**/libsodium.*")[0].split(os.sep)[:2])
)
print("Found VCPKG_PORT_PATH: ", VCPKG_PORT_BASE_PATH)
if sys.platform == "win32":
# Windows specific setup
link_libararies = ["libsodium"]
macros += [("SODIUM_STATIC", 1), ("SODIUM_EXPORT", None)]
runtime_libs = []
include_dirs += [os.path.join(VCPKG_PORT_BASE_PATH, "include/")]
library_dirs += [os.path.join(VCPKG_PORT_BASE_PATH, "lib/")]
setup(
packages=find_packages(),
ext_modules=[
Pybind11Extension(
"__CryptoLib",
glob("CryptoLib/*.cpp"),
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=link_libararies,
runtime_library_dirs=runtime_libs,
extra_compile_args=extra_args,
extra_link_args=extra_args + extra_link_args,
define_macros=macros,
)
],
cmdclass={"build_ext": build_ext}
)