@@ -30,9 +30,6 @@ class CMakeBuild(build_ext):
30
30
def build_extension (self , ext ): # noqa C901
31
31
extdir = os .path .abspath (os .path .dirname (self .get_ext_fullpath (ext .name )))
32
32
33
- # Ensure the extension goes into the pytorch_tokenizers package directory
34
- extdir = os .path .join (extdir , "pytorch_tokenizers" )
35
-
36
33
# Required for auto-detection & inclusion of auxiliary "native" libs
37
34
if not extdir .endswith (os .path .sep ):
38
35
extdir += os .path .sep
@@ -55,6 +52,10 @@ def build_extension(self, ext): # noqa C901
55
52
]
56
53
build_args = ["--target" , "pytorch_tokenizers_cpp" ]
57
54
55
+ # Use Clang for Windows builds.
56
+ if sys .platform == "win32" :
57
+ cmake_args += ["-T ClangCL" ]
58
+
58
59
# Adding CMake arguments set as environment variable
59
60
# (needed e.g. to build for ARM OSX on conda-forge)
60
61
if "CMAKE_ARGS" in os .environ :
@@ -124,15 +125,14 @@ def build_extension(self, ext): # noqa C901
124
125
["cmake" , "--build" , "." ] + build_args , cwd = build_temp , check = True
125
126
)
126
127
127
-
128
128
setup (
129
129
name = "pytorch-tokenizers" ,
130
130
version = "0.1.0" ,
131
131
long_description = long_description ,
132
132
long_description_content_type = "text/markdown" ,
133
133
url = "https://github.com/meta-pytorch/tokenizers" ,
134
134
packages = find_packages (),
135
- ext_modules = [CMakeExtension ("pytorch_tokenizers_cpp" )],
135
+ ext_modules = [CMakeExtension ("pytorch_tokenizers. pytorch_tokenizers_cpp" )],
136
136
cmdclass = {"build_ext" : CMakeBuild },
137
137
zip_safe = False ,
138
138
python_requires = ">=3.10" ,
0 commit comments