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 Cython.Build import cythonize
|
||||
import os
|
||||
import sys
|
||||
|
||||
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=['-std=c++17','/EHsc','/std:c++17'],
|
||||
extra_link_args=['-std=c++17','/EHsc','/std:c++17'],
|
||||
)
|
||||
|
||||
print("building on platform: "+sys.platform)
|
||||
os.system("git tag > gittags.log")
|
||||
with open ("gittags.log","r") as gt:
|
||||
taglst = gt.readlines()
|
||||
@ -25,6 +15,27 @@ 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 = ['/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(
|
||||
version=version,
|
||||
description='TDMtermite cython extension',
|
||||
|
Loading…
x
Reference in New Issue
Block a user