update setup.py

This commit is contained in:
Taku Kudo 2022-06-03 00:55:38 +09:00
parent 45346977ff
commit 7a5d14cfdf

View File

@ -58,14 +58,18 @@ def is_sentencepiece_installed():
def get_cflags_and_libs(root):
cflags = ['-std=c++11']
cflags = cflags + ['-std=c++11', '-I' + os.path.join(root, 'include')]
libs = []
if os.path.exists(os.path.join(root, 'lib/pkgconfig/sentencepiece.pc')):
cflags = cflags + ['-I' + os.path.join(root, 'include')]
libs = [
os.path.join(root, 'lib/libsentencepiece.a'),
os.path.join(root, 'lib/libsentencepiece_train.a'),
]
elif os.path.exists(os.path.join(root, 'lib64/pkgconfig/sentencepiece.pc')):
libs = [
os.path.join(root, 'lib64/libsentencepiece.a'),
os.path.join(root, 'lib64/libsentencepiece_train.a'),
]
return cflags, libs