-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·43 lines (35 loc) · 1014 Bytes
/
setup.py
File metadata and controls
executable file
·43 lines (35 loc) · 1014 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3
"""
C++ Extension Build Configuration
This file is used by setuptools to build the C++ extension module.
All project metadata is defined in pyproject.toml (PEP 621).
"""
import os
import glob
import platform
from setuptools import setup, Extension
dir_path = os.path.dirname(os.path.realpath(__file__))
class PyBind11Include:
def __str__(self):
import pybind11
return pybind11.get_include()
extra_compile_args = []
if platform.system() == "Windows":
extra_compile_args.append('/std:c++17')
else:
extra_compile_args.append('-std=c++17')
setup(
ext_modules=[
Extension(
'pytomlpp._impl',
['src/pytomlpp.cpp', 'src/type_casters.cpp', 'src/encoding_decoding.cpp'],
include_dirs=[
dir_path + '/include',
dir_path + '/third_party',
PyBind11Include(),
],
extra_compile_args=extra_compile_args,
language='c++',
),
],
)