Fixed build error on Mac.

This commit is contained in:
Taku Kudo 2020-10-22 09:49:33 +09:00
parent 9dee6649ae
commit d8c4b04056
4 changed files with 9 additions and 6 deletions

1
.gitignore vendored
View File

@ -70,3 +70,4 @@ m.vocab
cmake_install.cmake
libsentencepiece.so*
libsentencepiece_train.so*
python/bundled

View File

@ -1,3 +1,3 @@
recursive-include test *.py *.model botchan.txt
include *.i *.md VERSION
include build_bundled.sh
recursive-include src *.i
include *.md VERSION build_bundled.sh

View File

@ -42,7 +42,7 @@ build() {
for i in /opt/python/*
do
$i/bin/python setup.py bdist
strip build/*/*.so
strip build/*/*/*.so
$i/bin/python setup.py bdist_wheel
$i/bin/python setup.py test
rm -fr build

View File

@ -53,9 +53,11 @@ def run_pkg_config(section, pkg_config_path=None):
def is_sentencepiece_installed():
return subprocess.run(
'pkg-config sentencepiece --libs', shell=True,
check=False).returncode == 0
try:
subprocess.check_call('pkg-config sentencepiece --libs', shell=True)
return True
except subprocess.CalledProcessError:
return False
class build_ext(_build_ext):