@@ -30,9 +30,6 @@ class CMakeBuild(build_ext):
3030 def build_extension (self , ext ): # noqa C901
3131 extdir = os .path .abspath (os .path .dirname (self .get_ext_fullpath (ext .name )))
3232
33- # Ensure the extension goes into the pytorch_tokenizers package directory
34- extdir = os .path .join (extdir , "pytorch_tokenizers" )
35-
3633 # Required for auto-detection & inclusion of auxiliary "native" libs
3734 if not extdir .endswith (os .path .sep ):
3835 extdir += os .path .sep
@@ -55,6 +52,10 @@ def build_extension(self, ext): # noqa C901
5552 ]
5653 build_args = ["--target" , "pytorch_tokenizers_cpp" ]
5754
55+ # Use Clang for Windows builds.
56+ if sys .platform == "win32" :
57+ cmake_args += ["-T ClangCL" ]
58+
5859 # Adding CMake arguments set as environment variable
5960 # (needed e.g. to build for ARM OSX on conda-forge)
6061 if "CMAKE_ARGS" in os .environ :
@@ -132,7 +133,7 @@ def build_extension(self, ext): # noqa C901
132133 long_description_content_type = "text/markdown" ,
133134 url = "https://github.com/meta-pytorch/tokenizers" ,
134135 packages = find_packages (),
135- ext_modules = [CMakeExtension ("pytorch_tokenizers_cpp" )],
136+ ext_modules = [CMakeExtension ("pytorch_tokenizers. pytorch_tokenizers_cpp" )],
136137 cmdclass = {"build_ext" : CMakeBuild },
137138 zip_safe = False ,
138139 python_requires = ">=3.10" ,
0 commit comments