Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
86 lines (74 loc) · 2.57 KB

File metadata and controls

86 lines (74 loc) · 2.57 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import os
import platform
import sys
import sysconfig
from setuptools import setup
from setuptools.extension import Extension
from distutils.command.install_headers import install_headers
def is_posix():
return platform.os.name == "posix"
def link_libs():
libs = []
if is_posix():
libs.append("stdc++")
return libs
class get_pybind_include(object):
def __init__(self, user=False):
self.user = user
def __str__(self):
import pybind11
return pybind11.get_include(self.user)
def get_include_dirs():
include_dirs=[
'spdlog/include/',
get_pybind_include(),
get_pybind_include(user=True),
]
conda_prefix = os.environ.get('CONDA_PREFIX')
if conda_prefix is not None:
include_dirs.append(os.path.join(conda_prefix, "include"))
return include_dirs
def include_dir_files(folder):
"""Find all C++ header files in folder"""
from os import walk
files = []
for (dirpath, _, filenames) in walk(folder):
for fn in filenames:
if os.path.splitext(fn)[1] in {'.h', '.hpp'}:
files.append(os.path.join(dirpath, fn))
return files
class install_headers_subdir(install_headers):
"""Install headers and keep subfolder structure"""
def run(self):
headers = self.distribution.headers or []
for header in headers:
submod_dir = os.path.dirname(os.path.relpath(header, 'spdlog/include/spdlog'))
install_dir = os.path.join(self.install_dir, submod_dir)
self.mkpath(install_dir)
(out, _) = self.copy_file(header, install_dir)
self.outfiles.append(out)
setup(
name='spdlog',
version='2.0.6',
author='Gergely Bod',
author_email='bodgergely@hotmail.com',
description='python wrapper around C++ spdlog logging library (https://github.com/bodgergely/spdlog-python)',
license='MIT',
long_description='python wrapper (https://github.com/bodgergely/spdlog-python) around C++ spdlog (http://github.com/gabime/spdlog.git) logging library.',
setup_requires=['pybind11>=2.2', 'wheel', 'pytest-runner'],
install_requires=['pybind11>=2.2'],
tests_require=['pytest'],
ext_modules=[
Extension(
'spdlog',
['src/pyspdlog.cpp'],
include_dirs=get_include_dirs(),
libraries=link_libs(),
extra_compile_args=["-std=c++11", "-v"],
language='c++11'
)
],
headers=include_dir_files('spdlog/include/spdlog'),
cmdclass={'install_headers': install_headers_subdir},
zip_safe=False,
)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.