| 66 | |
| 67 | |
| 68 | def get_cflags_and_libs(root): |
| 69 | cflags = ['-std=c++17', '-I' + os.path.join(root, 'include')] |
| 70 | libs = [] |
| 71 | if os.path.exists(os.path.join(root, 'lib/pkgconfig/sentencepiece.pc')): |
| 72 | libs = [ |
| 73 | os.path.join(root, 'lib/libsentencepiece.a'), |
| 74 | os.path.join(root, 'lib/libsentencepiece_train.a'), |
| 75 | ] |
| 76 | elif os.path.exists(os.path.join(root, 'lib64/pkgconfig/sentencepiece.pc')): |
| 77 | libs = [ |
| 78 | os.path.join(root, 'lib64/libsentencepiece.a'), |
| 79 | os.path.join(root, 'lib64/libsentencepiece_train.a'), |
| 80 | ] |
| 81 | return cflags, libs |
| 82 | |
| 83 | |
| 84 | class build_ext(_build_ext): |