consider platform dependency for building cython extension locally
This commit is contained in:
parent
5e93ed0706
commit
601613b6c4
@ -1,6 +1,28 @@
|
|||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
from distutils.extension import Extension
|
from distutils.extension import Extension
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
print("building on platform: "+sys.platform)
|
||||||
|
os.system("git tag > gittags.log")
|
||||||
|
with open ("gittags.log","r") as gt:
|
||||||
|
taglst = gt.readlines()
|
||||||
|
os.remove("gittags.log")
|
||||||
|
if len(taglst) > 0 :
|
||||||
|
version = taglst[-1].replace('\n','').replace('v','')
|
||||||
|
else:
|
||||||
|
version = 'unkown'
|
||||||
|
print("building version: "+version)
|
||||||
|
|
||||||
|
if sys.platform == "linux" or sys.platform == "darwin" :
|
||||||
|
cmpargs = ['-std=c++17','-Wno-unused-variable']
|
||||||
|
lnkargs = ['-std=c++17','-Wno-unused-variable']
|
||||||
|
elif sys.platform == "win32" :
|
||||||
|
cmpargs = ['/EHsc','/std:c++17']
|
||||||
|
lnkargs = []
|
||||||
|
else :
|
||||||
|
raise RuntimeError("unknown platform")
|
||||||
|
|
||||||
extensions = Extension(
|
extensions = Extension(
|
||||||
name="imc_termite",
|
name="imc_termite",
|
||||||
@ -9,12 +31,12 @@ extensions = Extension(
|
|||||||
# library_dirs=["lib"],
|
# library_dirs=["lib"],
|
||||||
include_dirs=["lib"],
|
include_dirs=["lib"],
|
||||||
language='c++',
|
language='c++',
|
||||||
extra_compile_args=['-std=c++17','-Wno-unused-variable'],
|
extra_compile_args=cmpargs,
|
||||||
extra_link_args=['-std=c++17'],
|
extra_link_args=lnkargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="imc_termite",
|
name='imc_termite',
|
||||||
version='1.2.10',
|
version='1.2.10',
|
||||||
description='IMCtermite cython extension',
|
description='IMCtermite cython extension',
|
||||||
author='Record Evolution GmbH',
|
author='Record Evolution GmbH',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user