File size: 911 Bytes
82ea528
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
import sys
import os
import pybind11
class BuildExt(build_ext):
    def build_extensions(self):
        if sys.platform == 'win32':
            # Windows-specific compiler flags
            for ext in self.extensions:
                ext.extra_compile_args = ['/O2', '/Wall']
        else:
            # Linux/Mac flags
            for ext in self.extensions:
                ext.extra_compile_args = ['-O3', '-Wall', '-fPIC']
        build_ext.build_extensions(self)

setup(
    name="mesh_processor",
    ext_modules=[
        Extension(
            "mesh_processor",
            ["mesh_processor.cpp"],
            include_dirs=[
                pybind11.get_include(),
                pybind11.get_include(user=True)
            ],
            language='c++'
        ),
    ],
    cmdclass={'build_ext': BuildExt},
)