@@ -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 :
@@ -132,7 +133,7 @@ def build_extension(self, ext): # noqa C901
132
133
long_description_content_type = "text/markdown" ,
133
134
url = "https://github.com/meta-pytorch/tokenizers" ,
134
135
packages = find_packages (),
135
- ext_modules = [CMakeExtension ("pytorch_tokenizers_cpp" )],
136
+ ext_modules = [CMakeExtension ("pytorch_tokenizers. pytorch_tokenizers_cpp" )],
136
137
cmdclass = {"build_ext" : CMakeBuild },
137
138
zip_safe = False ,
138
139
python_requires = ">=3.10" ,
0 commit comments