52 lines
1.5 KiB
Python
52 lines
1.5 KiB
Python
from setuptools import setup, Extension
|
|
import platform
|
|
|
|
extra_compile_args = []
|
|
extra_link_args = []
|
|
|
|
# Set C++17 flag based on the compiler
|
|
if platform.system() == "Windows":
|
|
extra_compile_args.append('/std:c++17')
|
|
else:
|
|
extra_compile_args.append('-std=c++17')
|
|
|
|
simple_functions_module = Extension(
|
|
'fabelous_math.simple_functions',
|
|
sources=[
|
|
'src/fabelous_math/cpp/functions/simple_functions.cpp',
|
|
'src/fabelous_math/cpp/functions/bindings/simple_functions_bindings.cpp'
|
|
],
|
|
include_dirs=['src/fabelous_math/include'],
|
|
extra_compile_args=extra_compile_args,
|
|
extra_link_args=extra_link_args,
|
|
)
|
|
|
|
pi_module = Extension(
|
|
'fabelous_math.pi',
|
|
sources=[
|
|
'src/fabelous_math/cpp/functions/pi.cpp',
|
|
'src/fabelous_math/cpp/functions/bindings/pi_bindings.cpp'
|
|
],
|
|
include_dirs=['src/fabelous_math/include'],
|
|
extra_compile_args=extra_compile_args,
|
|
extra_link_args=extra_link_args,
|
|
)
|
|
|
|
sqrt_module = Extension(
|
|
'fabelous_math.rooting',
|
|
sources=[
|
|
'src/fabelous_math/cpp/functions/rooting.cpp',
|
|
'src/fabelous_math/cpp/functions/bindings/rooting_bindings.cpp'
|
|
],
|
|
include_dirs=['src/fabelous_math/include'],
|
|
extra_compile_args=extra_compile_args,
|
|
extra_link_args=extra_link_args,
|
|
)
|
|
|
|
setup(
|
|
name='fabelous_math',
|
|
description='Math functions written in C++ for faster code',
|
|
ext_modules=[simple_functions_module, sqrt_module, pi_module],
|
|
author="Falko Habel",
|
|
author_email="falko.habel@fabelous.app"
|
|
) |