-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.py
More file actions
28 lines (25 loc) · 814 Bytes
/
setup.py
File metadata and controls
28 lines (25 loc) · 814 Bytes
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
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import pathlib
import setuptools
import cmake_build_extension
cmake_flags = [
"-DBUILD_SHARED_LIBS:BOOL=OFF",
"-DCALL_FROM_SETUP_PY:BOOL=ON",
]
if "CMAKE_FLAGS" in os.environ:
flags = os.environ["CMAKE_FLAGS"]
cmake_flags.extend(flags.split())
setuptools.setup(
ext_modules=[
cmake_build_extension.CMakeExtension(
name="realsr-ncnn-vulkan-python",
install_prefix="realsr_ncnn_vulkan_python",
write_top_level_init="from .realsr_ncnn_vulkan import Realsr, RealSR, wrapped",
source_dir=str(pathlib.Path(__file__).parent / "realsr_ncnn_vulkan_python"),
cmake_configure_options=cmake_flags,
)
],
cmdclass={"build_ext": cmake_build_extension.BuildExtension},
)