introduce platform dependent compile/link options for setup.py
This commit is contained in:
parent
dc23b1e753
commit
6b7e0258b3
@ -2,19 +2,9 @@ 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 os
|
||||||
|
import sys
|
||||||
|
|
||||||
extensions = Extension(
|
print("building on platform: "+sys.platform)
|
||||||
name="tdm_termite",
|
|
||||||
sources=["cython/py_tdm_termite.pyx"],
|
|
||||||
# libraries=[""],
|
|
||||||
# library_dirs=["lib"],
|
|
||||||
include_dirs=["lib","3rdparty/pugixml"],
|
|
||||||
language='c++',
|
|
||||||
#extra_compile_args=['-std=c++17','-Wno-unused-variable'],
|
|
||||||
extra_compile_args=['-std=c++17','/EHsc','/std:c++17'],
|
|
||||||
extra_link_args=['-std=c++17','/EHsc','/std:c++17'],
|
|
||||||
)
|
|
||||||
|
|
||||||
os.system("git tag > gittags.log")
|
os.system("git tag > gittags.log")
|
||||||
with open ("gittags.log","r") as gt:
|
with open ("gittags.log","r") as gt:
|
||||||
taglst = gt.readlines()
|
taglst = gt.readlines()
|
||||||
@ -25,6 +15,27 @@ else:
|
|||||||
version = 'unkown'
|
version = 'unkown'
|
||||||
print("building version: "+version)
|
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 = ['/EHsc','/std:c++17']
|
||||||
|
else :
|
||||||
|
raise RuntimeError("unknown platform")
|
||||||
|
|
||||||
|
extensions = Extension(
|
||||||
|
name="tdm_termite",
|
||||||
|
sources=["cython/py_tdm_termite.pyx"],
|
||||||
|
# libraries=[""],
|
||||||
|
# library_dirs=["lib"],
|
||||||
|
include_dirs=["lib","3rdparty/pugixml"],
|
||||||
|
language='c++',
|
||||||
|
#extra_compile_args=['-std=c++17','-Wno-unused-variable'],
|
||||||
|
extra_compile_args= cmpargs,
|
||||||
|
extra_link_args= lnkargs,
|
||||||
|
)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
version=version,
|
version=version,
|
||||||
description='TDMtermite cython extension',
|
description='TDMtermite cython extension',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user